
#pragma warning disable 162

namespace PeDALS.SC.Orchestrations
{

    [System.SerializableAttribute]
    sealed public class __PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Manifest__ : Microsoft.XLANGs.Core.XSDPart
    {
        private static PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Manifest _schema = new PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Manifest();

        public __PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Manifest__(Microsoft.XLANGs.Core.XMessage msg, string name, int index) : base(msg, name, index) { }

        
        #region part reflection support
        public static Microsoft.XLANGs.BaseTypes.SchemaBase PartSchema { get { return (Microsoft.XLANGs.BaseTypes.SchemaBase)_schema; } }
        #endregion // part reflection support
    }

    [Microsoft.XLANGs.BaseTypes.MessageTypeAttribute(
        Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal,
        Microsoft.XLANGs.BaseTypes.EXLangSMessageInfo.eNone,
        "",
        new System.Type[]{
            typeof(PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Manifest)
        },
        new string[]{
            "Body"
        },
        new System.Type[]{
            typeof(__PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Manifest__)
        },
        0,
        @"manifest"
    )]
    [System.SerializableAttribute]
    sealed internal class PublicServiceCommissionOrdersManifestMessageType : Microsoft.BizTalk.XLANGs.BTXEngine.BTXMessage
    {
        public __PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Manifest__ Body;

        private void __CreatePartWrappers()
        {
            Body = new __PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Manifest__(this, "Body", 0);
            this.AddPart("Body", 0, Body);
        }

        public PublicServiceCommissionOrdersManifestMessageType(string msgName, Microsoft.XLANGs.Core.Context ctx) : base(msgName, ctx)
        {
            __CreatePartWrappers();
        }
    }

    [System.SerializableAttribute]
    sealed public class __PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_File__ : Microsoft.XLANGs.Core.XSDPart
    {
        private static PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_File _schema = new PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_File();

        public __PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_File__(Microsoft.XLANGs.Core.XMessage msg, string name, int index) : base(msg, name, index) { }

        
        #region part reflection support
        public static Microsoft.XLANGs.BaseTypes.SchemaBase PartSchema { get { return (Microsoft.XLANGs.BaseTypes.SchemaBase)_schema; } }
        #endregion // part reflection support
    }

    [Microsoft.XLANGs.BaseTypes.MessageTypeAttribute(
        Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal,
        Microsoft.XLANGs.BaseTypes.EXLangSMessageInfo.eNone,
        "",
        new System.Type[]{
            typeof(PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_File)
        },
        new string[]{
            "Body"
        },
        new System.Type[]{
            typeof(__PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_File__)
        },
        0,
        @"file"
    )]
    [System.SerializableAttribute]
    sealed internal class PublicServiceCommissionOrdersFileMessageType : Microsoft.BizTalk.XLANGs.BTXEngine.BTXMessage
    {
        public __PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_File__ Body;

        private void __CreatePartWrappers()
        {
            Body = new __PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_File__(this, "Body", 0);
            this.AddPart("Body", 0, Body);
        }

        public PublicServiceCommissionOrdersFileMessageType(string msgName, Microsoft.XLANGs.Core.Context ctx) : base(msgName, ctx)
        {
            __CreatePartWrappers();
        }
    }

    [System.SerializableAttribute]
    sealed public class __PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Metadata__ : Microsoft.XLANGs.Core.XSDPart
    {
        private static PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Metadata _schema = new PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Metadata();

        public __PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Metadata__(Microsoft.XLANGs.Core.XMessage msg, string name, int index) : base(msg, name, index) { }

        
        #region part reflection support
        public static Microsoft.XLANGs.BaseTypes.SchemaBase PartSchema { get { return (Microsoft.XLANGs.BaseTypes.SchemaBase)_schema; } }
        #endregion // part reflection support
    }

    [Microsoft.XLANGs.BaseTypes.MessageTypeAttribute(
        Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal,
        Microsoft.XLANGs.BaseTypes.EXLangSMessageInfo.eNone,
        "",
        new System.Type[]{
            typeof(PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Metadata)
        },
        new string[]{
            "Body"
        },
        new System.Type[]{
            typeof(__PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Metadata__)
        },
        0,
        @"orders"
    )]
    [System.SerializableAttribute]
    sealed internal class PublicServiceCommissionOrdersMetadataMessageType : Microsoft.BizTalk.XLANGs.BTXEngine.BTXMessage
    {
        public __PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Metadata__ Body;

        private void __CreatePartWrappers()
        {
            Body = new __PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Metadata__(this, "Body", 0);
            this.AddPart("Body", 0, Body);
        }

        public PublicServiceCommissionOrdersMetadataMessageType(string msgName, Microsoft.XLANGs.Core.Context ctx) : base(msgName, ctx)
        {
            __CreatePartWrappers();
        }
    }

    [Microsoft.XLANGs.BaseTypes.PortTypeOperationAttribute(
        "GetPSCManifest",
        new System.Type[]{
            typeof(PeDALS.SC.Orchestrations.PublicServiceCommissionOrdersManifestMessageType)
        },
        new string[]{
        }
    )]
    [Microsoft.XLANGs.BaseTypes.PortTypeAttribute(Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal, "")]
    [System.SerializableAttribute]
    sealed internal class PSCShippingManifestPortType : Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase
    {
        public PSCShippingManifestPortType(int portInfo, Microsoft.XLANGs.Core.IServiceProxy s)
            : base(portInfo, s)
        { }
        public PSCShippingManifestPortType(PSCShippingManifestPortType p)
            : base(p)
        { }

        public override Microsoft.XLANGs.Core.PortBase Clone()
        {
            PSCShippingManifestPortType p = new PSCShippingManifestPortType(this);
            return p;
        }

        public static readonly Microsoft.XLANGs.BaseTypes.EXLangSAccess __access = Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal;
        #region port reflection support
        static public Microsoft.XLANGs.Core.OperationInfo GetPSCManifest = new Microsoft.XLANGs.Core.OperationInfo
        (
            "GetPSCManifest",
            System.Web.Services.Description.OperationFlow.OneWay,
            typeof(PSCShippingManifestPortType),
            typeof(PublicServiceCommissionOrdersManifestMessageType),
            null,
            new System.Type[]{},
            new string[]{}
        );
        static public System.Collections.Hashtable OperationsInformation
        {
            get
            {
                System.Collections.Hashtable h = new System.Collections.Hashtable();
                h[ "GetPSCManifest" ] = GetPSCManifest;
                return h;
            }
        }
        #endregion // port reflection support
    }

    [System.SerializableAttribute]
    sealed public class __PeDALS_Schema_AIP_ManifestComplete__ : Microsoft.XLANGs.Core.XSDPart
    {
        private static PeDALS.Schema.AIP.ManifestComplete _schema = new PeDALS.Schema.AIP.ManifestComplete();

        public __PeDALS_Schema_AIP_ManifestComplete__(Microsoft.XLANGs.Core.XMessage msg, string name, int index) : base(msg, name, index) { }

        
        #region part reflection support
        public static Microsoft.XLANGs.BaseTypes.SchemaBase PartSchema { get { return (Microsoft.XLANGs.BaseTypes.SchemaBase)_schema; } }
        #endregion // part reflection support
    }

    [Microsoft.XLANGs.BaseTypes.MessageTypeAttribute(
        Microsoft.XLANGs.BaseTypes.EXLangSAccess.ePublic,
        Microsoft.XLANGs.BaseTypes.EXLangSMessageInfo.eThirdKind,
        "PeDALS.Schema.AIP.ManifestComplete",
        new System.Type[]{
            typeof(PeDALS.Schema.AIP.ManifestComplete)
        },
        new string[]{
            "part"
        },
        new System.Type[]{
            typeof(__PeDALS_Schema_AIP_ManifestComplete__)
        },
        0,
        @"http://PeDALS.Schema#Manifest"
    )]
    [System.SerializableAttribute]
    sealed public class __messagetype_PeDALS_Schema_AIP_ManifestComplete : Microsoft.BizTalk.XLANGs.BTXEngine.BTXMessage
    {
        public __PeDALS_Schema_AIP_ManifestComplete__ part;

        private void __CreatePartWrappers()
        {
            part = new __PeDALS_Schema_AIP_ManifestComplete__(this, "part", 0);
            this.AddPart("part", 0, part);
        }

        public __messagetype_PeDALS_Schema_AIP_ManifestComplete(string msgName, Microsoft.XLANGs.Core.Context ctx) : base(msgName, ctx)
        {
            __CreatePartWrappers();
        }
    }

    [System.SerializableAttribute]
    sealed public class __Microsoft_XLANGs_BaseTypes_Any__ : Microsoft.XLANGs.Core.XSDPart
    {
        private static Microsoft.XLANGs.BaseTypes.Any _schema = new Microsoft.XLANGs.BaseTypes.Any();

        public __Microsoft_XLANGs_BaseTypes_Any__(Microsoft.XLANGs.Core.XMessage msg, string name, int index) : base(msg, name, index) { }

        
        #region part reflection support
        public static Microsoft.XLANGs.BaseTypes.SchemaBase PartSchema { get { return (Microsoft.XLANGs.BaseTypes.SchemaBase)_schema; } }
        #endregion // part reflection support
    }

    [Microsoft.XLANGs.BaseTypes.MessageTypeAttribute(
        Microsoft.XLANGs.BaseTypes.EXLangSAccess.ePublic,
        Microsoft.XLANGs.BaseTypes.EXLangSMessageInfo.eThirdKind,
        "System.Xml.XmlDocument",
        new System.Type[]{
            typeof(Microsoft.XLANGs.BaseTypes.Any)
        },
        new string[]{
            "part"
        },
        new System.Type[]{
            typeof(__Microsoft_XLANGs_BaseTypes_Any__)
        },
        0,
        Microsoft.XLANGs.Core.XMessage.AnyMessageTypeName
    )]
    [System.SerializableAttribute]
    sealed public class __messagetype_System_Xml_XmlDocument : Microsoft.BizTalk.XLANGs.BTXEngine.BTXMessage
    {
        public __Microsoft_XLANGs_BaseTypes_Any__ part;

        private void __CreatePartWrappers()
        {
            part = new __Microsoft_XLANGs_BaseTypes_Any__(this, "part", 0);
            this.AddPart("part", 0, part);
        }

        public __messagetype_System_Xml_XmlDocument(string msgName, Microsoft.XLANGs.Core.Context ctx) : base(msgName, ctx)
        {
            __CreatePartWrappers();
        }
    }

    [Microsoft.XLANGs.BaseTypes.PortTypeOperationAttribute(
        "Operation",
        new System.Type[]{
            typeof(PeDALS.SC.Orchestrations.__messagetype_PeDALS_Schema_AIP_ManifestComplete)
        },
        new string[]{
        }
    )]
    [Microsoft.XLANGs.BaseTypes.PortTypeAttribute(Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal, "")]
    [System.SerializableAttribute]
    sealed internal class ManifestCompletePortType : Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase
    {
        public ManifestCompletePortType(int portInfo, Microsoft.XLANGs.Core.IServiceProxy s)
            : base(portInfo, s)
        { }
        public ManifestCompletePortType(ManifestCompletePortType p)
            : base(p)
        { }

        public override Microsoft.XLANGs.Core.PortBase Clone()
        {
            ManifestCompletePortType p = new ManifestCompletePortType(this);
            return p;
        }

        public static readonly Microsoft.XLANGs.BaseTypes.EXLangSAccess __access = Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal;
        #region port reflection support
        static public Microsoft.XLANGs.Core.OperationInfo Operation = new Microsoft.XLANGs.Core.OperationInfo
        (
            "Operation",
            System.Web.Services.Description.OperationFlow.OneWay,
            typeof(ManifestCompletePortType),
            typeof(__messagetype_PeDALS_Schema_AIP_ManifestComplete),
            null,
            new System.Type[]{},
            new string[]{}
        );
        static public System.Collections.Hashtable OperationsInformation
        {
            get
            {
                System.Collections.Hashtable h = new System.Collections.Hashtable();
                h[ "Operation" ] = Operation;
                return h;
            }
        }
        #endregion // port reflection support
    }

    [Microsoft.XLANGs.BaseTypes.PortTypeOperationAttribute(
        "PublishNotification",
        new System.Type[]{
            typeof(PeDALS.SC.Orchestrations.__messagetype_System_Xml_XmlDocument)
        },
        new string[]{
        }
    )]
    [Microsoft.XLANGs.BaseTypes.PortTypeAttribute(Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal, "")]
    [System.SerializableAttribute]
    sealed internal class NotificationPortType : Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase
    {
        public NotificationPortType(int portInfo, Microsoft.XLANGs.Core.IServiceProxy s)
            : base(portInfo, s)
        { }
        public NotificationPortType(NotificationPortType p)
            : base(p)
        { }

        public override Microsoft.XLANGs.Core.PortBase Clone()
        {
            NotificationPortType p = new NotificationPortType(this);
            return p;
        }

        public static readonly Microsoft.XLANGs.BaseTypes.EXLangSAccess __access = Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal;
        #region port reflection support
        static public Microsoft.XLANGs.Core.OperationInfo PublishNotification = new Microsoft.XLANGs.Core.OperationInfo
        (
            "PublishNotification",
            System.Web.Services.Description.OperationFlow.OneWay,
            typeof(NotificationPortType),
            typeof(__messagetype_System_Xml_XmlDocument),
            null,
            new System.Type[]{},
            new string[]{}
        );
        static public System.Collections.Hashtable OperationsInformation
        {
            get
            {
                System.Collections.Hashtable h = new System.Collections.Hashtable();
                h[ "PublishNotification" ] = PublishNotification;
                return h;
            }
        }
        #endregion // port reflection support
    }

    [Microsoft.XLANGs.BaseTypes.PortTypeOperationAttribute(
        "GetPSCOrders",
        new System.Type[]{
            typeof(PeDALS.SC.Orchestrations.PublicServiceCommissionOrdersMetadataMessageType)
        },
        new string[]{
        }
    )]
    [Microsoft.XLANGs.BaseTypes.PortTypeAttribute(Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal, "")]
    [System.SerializableAttribute]
    sealed internal class Get_PSC_Orders : Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase
    {
        public Get_PSC_Orders(int portInfo, Microsoft.XLANGs.Core.IServiceProxy s)
            : base(portInfo, s)
        { }
        public Get_PSC_Orders(Get_PSC_Orders p)
            : base(p)
        { }

        public override Microsoft.XLANGs.Core.PortBase Clone()
        {
            Get_PSC_Orders p = new Get_PSC_Orders(this);
            return p;
        }

        public static readonly Microsoft.XLANGs.BaseTypes.EXLangSAccess __access = Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal;
        #region port reflection support
        static public Microsoft.XLANGs.Core.OperationInfo GetPSCOrders = new Microsoft.XLANGs.Core.OperationInfo
        (
            "GetPSCOrders",
            System.Web.Services.Description.OperationFlow.OneWay,
            typeof(Get_PSC_Orders),
            typeof(PublicServiceCommissionOrdersMetadataMessageType),
            null,
            new System.Type[]{},
            new string[]{}
        );
        static public System.Collections.Hashtable OperationsInformation
        {
            get
            {
                System.Collections.Hashtable h = new System.Collections.Hashtable();
                h[ "GetPSCOrders" ] = GetPSCOrders;
                return h;
            }
        }
        #endregion // port reflection support
    }
    [Microsoft.XLANGs.BaseTypes.CorrelationTypeAttribute(
        Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal,
        new string[] {
            "BTS.ReceivePortID"
        }
    )]
    sealed internal class RecvPortIdCorrelationType : Microsoft.XLANGs.Core.CorrelationType
    {
        public static readonly Microsoft.XLANGs.BaseTypes.EXLangSAccess __access = Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal;
        private static Microsoft.XLANGs.BaseTypes.PropertyBase[] _properties = new Microsoft.XLANGs.BaseTypes.PropertyBase[] {
            new BTS.ReceivePortID()
         };
        public override Microsoft.XLANGs.BaseTypes.PropertyBase[] Properties { get { return _properties; } }
        public static Microsoft.XLANGs.BaseTypes.PropertyBase[] PropertiesList { get { return _properties; } }
    }
    //#line 1044 "C:\Projects\PeDALSSC\PeDALS.SC\PeDALS.SC.Orchestrations\PSCorders.odx"
    [Microsoft.XLANGs.BaseTypes.StaticConvoyAttribute(
        0,
        new System.Type[] { typeof(RecvPortIdCorrelationType) }
    )]
    [Microsoft.XLANGs.BaseTypes.StaticSubscriptionAttribute(
        0, "ManifestPort", "GetPSCManifest", -1, 0, true
    )]
    [Microsoft.XLANGs.BaseTypes.StaticSubscriptionAttribute(
        1, "NZMetadataExtractorPort", "NZ_Metadata_Extractor", -1, 0, true
    )]
    [Microsoft.XLANGs.BaseTypes.StaticSubscriptionAttribute(
        2, "OrdersPort", "GetPSCOrders", -1, 0, true
    )]
    [Microsoft.XLANGs.BaseTypes.ServicePortsAttribute(
        new Microsoft.XLANGs.BaseTypes.EXLangSParameter[] {
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.ePort|Microsoft.XLANGs.BaseTypes.EXLangSParameter.eImplements,
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.ePort|Microsoft.XLANGs.BaseTypes.EXLangSParameter.eImplements,
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.ePort|Microsoft.XLANGs.BaseTypes.EXLangSParameter.eImplements,
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.ePort|Microsoft.XLANGs.BaseTypes.EXLangSParameter.eUses,
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.ePort|Microsoft.XLANGs.BaseTypes.EXLangSParameter.eUses
        },
        new System.Type[] {
            typeof(PeDALS.SC.Orchestrations.PSCShippingManifestPortType),
            typeof(PeDALS.Orchestrations.NZMetadataPortType),
            typeof(PeDALS.SC.Orchestrations.Get_PSC_Orders),
            typeof(PeDALS.SC.Orchestrations.NotificationPortType),
            typeof(PeDALS.SC.Orchestrations.ManifestCompletePortType)
        },
        new System.String[] {
            "ManifestPort",
            "NZMetadataExtractorPort",
            "OrdersPort",
            "PublishNotificationPort",
            "ManifestCompletePort"
        },
        new System.Type[] {
            null,
            null,
            null,
            null,
            null
        }
    )]
    [Microsoft.XLANGs.BaseTypes.ServiceCallTreeAttribute(
        new System.Type[] {
            typeof(PeDALS.Orchestrations.GetInitialValues),
            typeof(PeDALS.Orchestrations.SplitNZMetadataMessage),
            typeof(PeDALS.Orchestrations.InsertAIP)
        },
        new System.Type[] {
        },
        new System.Type[] {
        }
    )]
    [Microsoft.XLANGs.BaseTypes.ServiceAttribute(
        Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal,
        Microsoft.XLANGs.BaseTypes.EXLangSServiceInfo.eNone|Microsoft.XLANGs.BaseTypes.EXLangSServiceInfo.eLongRunning
    )]
    [System.SerializableAttribute]
    [Microsoft.XLANGs.BaseTypes.BPELExportableAttribute(false)]
    sealed internal class PSCOrders : Microsoft.BizTalk.XLANGs.BTXEngine.BTXService
    {
        public static readonly Microsoft.XLANGs.BaseTypes.EXLangSAccess __access = Microsoft.XLANGs.BaseTypes.EXLangSAccess.eInternal;
        public static readonly bool __execable = false;
        [Microsoft.XLANGs.BaseTypes.CallCompensationAttribute(
            Microsoft.XLANGs.BaseTypes.EXLangSCallCompensationInfo.eNone,
            new System.String[] {
                "PeDALS.Orchestrations.GetInitialValues",
                "PeDALS.Orchestrations.SplitNZMetadataMessage",
                "PeDALS.Orchestrations.InsertAIP"
            },
            new System.String[] {
            }
        )]
        public static void __bodyProxy()
        {
        }
        private static System.Guid _serviceId = Microsoft.XLANGs.Core.HashHelper.HashServiceType(typeof(PSCOrders));
        private static volatile System.Guid[] _activationSubIds;

        private static new object _lockIdentity = new object();

        public static System.Guid UUID { get { return _serviceId; } }
        public override System.Guid ServiceId { get { return UUID; } }

        protected override System.Guid[] ActivationSubGuids
        {
            get { return _activationSubIds; }
            set { _activationSubIds = value; }
        }

        protected override object StaleStateLock
        {
            get { return _lockIdentity; }
        }

        protected override bool HasActivation { get { return true; } }

        internal bool IsExeced = false;

        static PSCOrders()
        {
            Microsoft.BizTalk.XLANGs.BTXEngine.BTXService.CacheStaticState( _serviceId );
        }

        private void ConstructorHelper()
        {
            _segments = new Microsoft.XLANGs.Core.Segment[] {
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment0), 0, 0, 0),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment1), 1, 1, 1),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment2), 1, 1, 2),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment3), 1, 2, 3),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment4), 1, 1, 4),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment5), 1, 3, 5),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment6), 1, 1, 6),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment7), 1, 4, 7),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment8), 1, 5, 8),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment9), 1, 6, 9),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment10), 1, 7, 10),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment11), 1, 7, 11),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment12), 1, 7, 12),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment13), 1, 8, 13),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment14), 1, 9, 14),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment15), 1, 10, 15),
                new Microsoft.XLANGs.Core.Segment( new Microsoft.XLANGs.Core.Segment.SegmentCode(this.segment16), 1, 11, 16)
            };

            _Locks = 0;
            _rootContext = new __PSCOrders_root_0(this);
            _stateMgrs = new Microsoft.XLANGs.Core.IStateManager[15];
            _stateMgrs[0] = _rootContext;
            FinalConstruct();
        }

        public PSCOrders(System.Guid instanceId, Microsoft.BizTalk.XLANGs.BTXEngine.BTXSession session, Microsoft.BizTalk.XLANGs.BTXEngine.BTXEvents tracker)
            : base(instanceId, session, "PSCOrders", tracker)
        {
            ConstructorHelper();
        }

        public PSCOrders(int callIndex, System.Guid instanceId, Microsoft.BizTalk.XLANGs.BTXEngine.BTXService parent)
            : base(callIndex, instanceId, parent, "PSCOrders")
        {
            ConstructorHelper();
        }

        private const string _symInfo = @"
<XsymFile>
<ProcessFlow xmlns:om='http://schemas.microsoft.com/BizTalk/2003/DesignerData'>      <shapeType>RootShape</shapeType>      <ShapeID>5c3f63e2-0ae0-4d4b-945d-2a0769f1ddd7</ShapeID>      
<children>                          
<ShapeInfo>      <shapeType>ParallelShape</shapeType>      <ShapeID>8eded03a-6b00-48a1-a114-e9e6a6db1c33</ShapeID>      <ParentLink>ServiceBody_Statement</ParentLink>                <shapeText>3 Messages to Start Process</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>ParallelBranchShape</shapeType>      <ShapeID>7605aa75-dfa3-4dac-89d7-3f8224295729</ShapeID>      <ParentLink>ReallyComplexStatement_Branch</ParentLink>                <shapeText>ParallelBranch_1</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>ReceiveShape</shapeType>      <ShapeID>454f167b-bc89-49a2-a240-c926014600d1</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>ReceiveShippingManifest</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ScopeShape</shapeType>      <ShapeID>8c590e61-a410-4610-905a-d34d38b0bff7</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>GetCountScope</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>985043b4-d731-4d68-b142-c4e600e8a461</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>GetNodeCount</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>VariableDeclarationShape</shapeType>      <ShapeID>80fce1dc-3331-4209-8226-98789a7977c0</ShapeID>      <ParentLink>Scope_VariableDeclaration</ParentLink>                <shapeText>manifestXml</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ParallelBranchShape</shapeType>      <ShapeID>7b890436-03d9-4ede-8e62-f3b917ae5ec4</ShapeID>      <ParentLink>ReallyComplexStatement_Branch</ParentLink>                <shapeText>ParallelBranch_2</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>ReceiveShape</shapeType>      <ShapeID>b3c88acc-7060-461b-a740-f2ce582e91ef</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>ReceiveNZMetadataMsg</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ScopeShape</shapeType>      <ShapeID>5dbe8c5b-b8dd-4b2c-935a-975ba7aff3ff</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>GetCountScope</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>699b7dcf-b1c4-4f0a-bc38-e066bf3b336d</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>GetNodeCount</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>VariableDeclarationShape</shapeType>      <ShapeID>e4124ed2-054b-4660-8f49-34aa27516b72</ShapeID>      <ParentLink>Scope_VariableDeclaration</ParentLink>                <shapeText>metadataXml</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ParallelBranchShape</shapeType>      <ShapeID>2763a69c-9aa2-490a-90ef-e9407554d7cd</ShapeID>      <ParentLink>ReallyComplexStatement_Branch</ParentLink>                <shapeText>ParallelBranch_3</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>ReceiveShape</shapeType>      <ShapeID>6edce67b-d70b-4566-9413-bbf069d18629</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>ReceivePSCordersMsg</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ScopeShape</shapeType>      <ShapeID>bd79e111-95a3-462b-8828-9afa05e54796</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>GetCountScope</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>cdb436ae-3e11-42fb-b11f-fea274b4f5c5</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>GetNodeCount</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>VariableDeclarationShape</shapeType>      <ShapeID>8496f006-0628-48c5-b4db-f3ea212b5c1a</ShapeID>      <ParentLink>Scope_VariableDeclaration</ParentLink>                <shapeText>ordersXml</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>DecisionShape</shapeType>      <ShapeID>cf0a62d0-1efe-42e5-a3ae-b01107f682b9</ShapeID>      <ParentLink>ServiceBody_Statement</ParentLink>                <shapeText>CountsMatch</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>DecisionBranchShape</shapeType>      <ShapeID>a50c37d1-6d0c-4dac-9c0b-abf539c2a029</ShapeID>      <ParentLink>ReallyComplexStatement_Branch</ParentLink>                <shapeText>No</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>ScopeShape</shapeType>      <ShapeID>2f6f9914-0c7b-4ca2-a708-7459a3bae31b</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>Notification</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>c529251e-79a1-41b3-8f02-9cf038a59535</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>DEBUG</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ConstructShape</shapeType>      <ShapeID>e08fd8a8-8205-466d-9022-4da8c159fd1c</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>ConstructNotificationMsg</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>MessageRefShape</shapeType>      <ShapeID>c6ae7d59-2398-4cd5-a4a9-ac3d72e10d29</ShapeID>      <ParentLink>Construct_MessageRef</ParentLink>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessageAssignmentShape</shapeType>      <ShapeID>0f135b4b-2bc9-419e-9d06-3d058176888e</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>AssignNotificationMsg</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>SendShape</shapeType>      <ShapeID>b08521d4-4d29-42d4-b57c-d3f887e648fc</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>SendNotification</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessageDeclarationShape</shapeType>      <ShapeID>e61efaee-f1bd-4ad7-a44d-4c2e451dec57</ShapeID>      <ParentLink>Scope_MessageDeclaration</ParentLink>                <shapeText>NotificationMsg</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>VariableDeclarationShape</shapeType>      <ShapeID>7e358bb9-91bb-4ca8-b596-75991305c248</ShapeID>      <ParentLink>Scope_VariableDeclaration</ParentLink>                <shapeText>zero</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>TerminateShape</shapeType>      <ShapeID>a9256c66-02a1-48ea-bbfd-eb71d79a5b41</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>TerminateOnCount</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>DecisionBranchShape</shapeType>      <ShapeID>ad2cc31d-4153-499f-a38d-9ccea54a57ed</ShapeID>      <ParentLink>ReallyComplexStatement_Branch</ParentLink>                <shapeText>Else</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ScopeShape</shapeType>      <ShapeID>b5961eed-755f-44b6-bdd4-bf8abf85065a</ShapeID>      <ParentLink>ServiceBody_Statement</ParentLink>                <shapeText>InitialValuesScope</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>CallShape</shapeType>      <ShapeID>140b02aa-fe7d-4e9c-bbdb-df85033b0544</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>GetInitialValues</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>ParameterShape</shapeType>      <ShapeID>c8ecf617-7b28-4da6-8985-d1a94a8d55b7</ShapeID>      <ParentLink>InvokeStatement_Parameter</ParentLink>                <shapeText>BaseAipMsg</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ParameterShape</shapeType>      <ShapeID>31528624-d200-4a4c-98ad-7fd6e9960af4</ShapeID>      <ParentLink>InvokeStatement_Parameter</ParentLink>                <shapeText>NZMetadataMsg</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ScopeShape</shapeType>      <ShapeID>2e8431ec-9ed6-4379-947a-3ee638b287cb</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>ScopeGetItem</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>66e4c22e-1b51-41b3-9398-69bb3f450ee6</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>SetVariables</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>CatchShape</shapeType>      <ShapeID>58241bd6-c432-44ab-ae1f-e2824d7b333d</ShapeID>      <ParentLink>Scope_Catch</ParentLink>                <shapeText>CatchNullRef</shapeText>                      <ExceptionType>System.NullReferenceException</ExceptionType>            
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>01fec934-7d35-47a8-9edf-50d727b32f98</ShapeID>      <ParentLink>Catch_Statement</ParentLink>                <shapeText>ThrowSpecific</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>CatchShape</shapeType>      <ShapeID>e7d65d3d-222a-45b5-b043-64272d32fc66</ShapeID>      <ParentLink>Scope_Catch</ParentLink>                <shapeText>CatchCastException</shapeText>                      <ExceptionType>System.InvalidCastException</ExceptionType>            
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>e4079179-31a6-4638-8cbc-f14258da3655</ShapeID>      <ParentLink>Catch_Statement</ParentLink>                <shapeText>ThrowSpecific</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessageDeclarationShape</shapeType>      <ShapeID>e7e33663-da78-4843-80bc-5afa9bda7dac</ShapeID>      <ParentLink>Scope_MessageDeclaration</ParentLink>                <shapeText>GetInitialValuesResponseMsg</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>LongRunningTransactionShape</shapeType>      <ShapeID>829da783-748f-4508-87e0-c3b5e2940e4a</ShapeID>      <ParentLink>Scope_Transaction</ParentLink>                <shapeText>Transaction_5</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ScopeShape</shapeType>      <ShapeID>4d178d9e-e695-4308-87bd-30236d4d2445</ShapeID>      <ParentLink>ServiceBody_Statement</ParentLink>                <shapeText>SplitFiles</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>VariableDeclarationShape</shapeType>      <ShapeID>bd2721a2-213d-428b-9196-fa134fc9417f</ShapeID>      <ParentLink>Scope_VariableDeclaration</ParentLink>                <shapeText>recCount</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>LongRunningTransactionShape</shapeType>      <ShapeID>cf1cee1e-8874-4241-8a2b-2ebfb80d1a5a</ShapeID>      <ParentLink>Scope_Transaction</ParentLink>                <shapeText>Transaction_2</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>0944c685-d5ac-4482-a077-01eb8386f59a</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>GetRecordCount</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>WhileShape</shapeType>      <ShapeID>fd7d317b-d1d3-41a1-96ed-38a127e7a365</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>LoopMultipleFile</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>ScopeShape</shapeType>      <ShapeID>bba9eb88-a980-4ff6-ae96-d71f9d4a1711</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>SplitManifestScope</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>ConstructShape</shapeType>      <ShapeID>9eb3f1b6-1865-456d-9046-85ae90e19c39</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>ConstructFileMsg</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>MessageAssignmentShape</shapeType>      <ShapeID>ee5333c1-b52d-4a87-9173-9c24f3d54fec</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>AssignFileMsg</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessageRefShape</shapeType>      <ShapeID>8b4d632e-5090-4a10-9e41-dcf5b1bb08dc</ShapeID>      <ParentLink>Construct_MessageRef</ParentLink>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>VariableDeclarationShape</shapeType>      <ShapeID>6f3c8b24-c7f8-4ad7-92b1-71d8dce1d9b5</ShapeID>      <ParentLink>Scope_VariableDeclaration</ParentLink>                <shapeText>xmlManifest</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>VariableDeclarationShape</shapeType>      <ShapeID>a07882a1-b104-44e9-804d-8c381c00cd71</ShapeID>      <ParentLink>Scope_VariableDeclaration</ParentLink>                <shapeText>xmlTemp</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ScopeShape</shapeType>      <ShapeID>21600035-28ec-4bd3-8802-155b8ae13d5a</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>SplitNZMetadata</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>faeea142-4f11-4155-aac7-2357c89e1d34</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>SetFileName</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>DecisionShape</shapeType>      <ShapeID>330a93dc-2192-4f67-88b4-4d6841ccd143</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>IsPDF</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>DecisionBranchShape</shapeType>      <ShapeID>1aefdd2b-f2f4-43dc-ae65-29e95be95e98</ShapeID>      <ParentLink>ReallyComplexStatement_Branch</ParentLink>                <shapeText>Yes</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>CallShape</shapeType>      <ShapeID>fd452544-d07f-4c11-a64b-b8d72ac0fef1</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>SplitNZMetadataMessage</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>ParameterShape</shapeType>      <ShapeID>d5d2c5b5-8be8-4b03-9799-a874ccb80bb3</ShapeID>      <ParentLink>InvokeStatement_Parameter</ParentLink>                <shapeText>NZMetadataFileMsg</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ParameterShape</shapeType>      <ShapeID>59fe3508-c677-4a64-a55f-590a537298b1</ShapeID>      <ParentLink>InvokeStatement_Parameter</ParentLink>                <shapeText>NZMetadataMsg</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ParameterShape</shapeType>      <ShapeID>8cfa467c-7627-4e75-9684-2b278f6a4bfc</ShapeID>      <ParentLink>InvokeStatement_Parameter</ParentLink>                <shapeText>fileName</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ConstructShape</shapeType>      <ShapeID>c10ae42c-d7e5-41df-a4f3-8b1c98ce491d</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>ConstructMessage_1</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>MessageAssignmentShape</shapeType>      <ShapeID>9392fdb7-23bd-44be-bd85-a312fff77d47</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>MessageAssignment_1</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessageRefShape</shapeType>      <ShapeID>6b913b94-0318-4047-81ac-696c78c208a1</ShapeID>      <ParentLink>Construct_MessageRef</ParentLink>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ScopeShape</shapeType>      <ShapeID>32c4e3b7-152d-484e-a890-4a7e765040d1</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>CreateFinalAIPScope</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>ConstructShape</shapeType>      <ShapeID>35003316-0b10-4d25-b77f-88eae41bb8d9</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>ConstructFinalAIP</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>MessageRefShape</shapeType>      <ShapeID>1b948714-c334-4244-b264-f4e28b1a3d82</ShapeID>      <ParentLink>Construct_MessageRef</ParentLink>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>TransformShape</shapeType>      <ShapeID>50881a4b-2c7d-4516-bf6e-7767945d0ec1</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>TransformBaseAipOrgMetadata_NZMetadataToFinalAIP</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>MessagePartRefShape</shapeType>      <ShapeID>1e4bbd42-6cfe-4dfc-9855-35e0636f09d3</ShapeID>      <ParentLink>Transform_InputMessagePartRef</ParentLink>                <shapeText>MessagePartReference_1</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessagePartRefShape</shapeType>      <ShapeID>230b8e11-62b0-48a3-b64e-a74c3e6ab32b</ShapeID>      <ParentLink>Transform_InputMessagePartRef</ParentLink>                <shapeText>MessagePartReference_2</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessagePartRefShape</shapeType>      <ShapeID>5e39f309-5e3d-42ca-afe3-52d649a5b1cc</ShapeID>      <ParentLink>Transform_InputMessagePartRef</ParentLink>                <shapeText>MessagePartReference_3</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessagePartRefShape</shapeType>      <ShapeID>732a2207-db8c-4ae4-b94a-fccf4aee9d5d</ShapeID>      <ParentLink>Transform_InputMessagePartRef</ParentLink>                <shapeText>MessagePartReference_5</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessagePartRefShape</shapeType>      <ShapeID>a0778fe3-8834-4c5f-8a93-fd47d4415d7f</ShapeID>      <ParentLink>Transform_OutputMessagePartRef</ParentLink>                <shapeText>MessagePartReference_4</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessageAssignmentShape</shapeType>      <ShapeID>817e4d76-bcf3-463e-9e52-f410eeb386a0</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>AddAdditionalInformation</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>CallShape</shapeType>      <ShapeID>e17ae477-e9c1-465f-b6bf-2b8bc526fe6f</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>CallInsertAip</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>ParameterShape</shapeType>      <ShapeID>9637aa98-557b-4a01-9fac-ab72ffcb9d9e</ShapeID>      <ParentLink>InvokeStatement_Parameter</ParentLink>                <shapeText>FinalAIPMsg</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>VariableDeclarationShape</shapeType>      <ShapeID>759d809e-d737-473f-884e-e9863becdf7e</ShapeID>      <ParentLink>Scope_VariableDeclaration</ParentLink>                <shapeText>orgFileAsBase64</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>VariableDeclarationShape</shapeType>      <ShapeID>84dcd552-b6a3-4568-a389-078196ca1c57</ShapeID>      <ParentLink>Scope_VariableDeclaration</ParentLink>                <shapeText>temp</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>VariableDeclarationShape</shapeType>      <ShapeID>e7c07206-9f45-4992-9ed1-dd59b70c951d</ShapeID>      <ParentLink>Scope_VariableDeclaration</ParentLink>                <shapeText>title</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>VariableDeclarationShape</shapeType>      <ShapeID>1969b2c9-44a9-4ac9-a5ad-90fe83872625</ShapeID>      <ParentLink>Scope_VariableDeclaration</ParentLink>                <shapeText>xmlTemp</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessageDeclarationShape</shapeType>      <ShapeID>ff9d893d-01b7-4e9b-8634-d194dbb17a34</ShapeID>      <ParentLink>Scope_MessageDeclaration</ParentLink>                <shapeText>FinalAIPMsg</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessageDeclarationShape</shapeType>      <ShapeID>2bba772b-2785-4639-a492-0a0109e2450a</ShapeID>      <ParentLink>Scope_MessageDeclaration</ParentLink>                <shapeText>OrgMetadataMsg</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>LongRunningTransactionShape</shapeType>      <ShapeID>f8e675ef-32e3-4f0e-802a-42527214234d</ShapeID>      <ParentLink>Scope_Transaction</ParentLink>                <shapeText>Transaction_4</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>DecisionBranchShape</shapeType>      <ShapeID>2cdc45ea-3fbc-4780-a64b-07f3f2186d58</ShapeID>      <ParentLink>ReallyComplexStatement_Branch</ParentLink>                <shapeText>Else</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>VariableDeclarationShape</shapeType>      <ShapeID>ece91c8e-1a6c-43d8-a7d9-67c358b9bd35</ShapeID>      <ParentLink>Scope_VariableDeclaration</ParentLink>                <shapeText>fileName</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>VariableDeclarationShape</shapeType>      <ShapeID>7084a108-67a7-4e4b-b211-82e40b341fe4</ShapeID>      <ParentLink>Scope_VariableDeclaration</ParentLink>                <shapeText>projType</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>VariableDeclarationShape</shapeType>      <ShapeID>df170316-7932-4df9-bf09-91040c51c499</ShapeID>      <ParentLink>Scope_VariableDeclaration</ParentLink>                <shapeText>xmlOrderMsg</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>VariableDeclarationShape</shapeType>      <ShapeID>051da556-2b65-44c0-9df6-bdc8c964c339</ShapeID>      <ParentLink>Scope_VariableDeclaration</ParentLink>                <shapeText>tempXML</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>LongRunningTransactionShape</shapeType>      <ShapeID>d002e7af-09c4-4dd7-b0e4-252716c0d9ea</ShapeID>      <ParentLink>Scope_Transaction</ParentLink>                <shapeText>Transaction_3</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>VariableAssignmentShape</shapeType>      <ShapeID>6049336b-e3b8-4c24-8857-d60ce5ab9515</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>IncrementRecordCount</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>ConstructShape</shapeType>      <ShapeID>69bac0fb-14e4-40b7-8607-6f95fe182b96</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>ConstructManifestComplete</shapeText>                  
<children>                          
<ShapeInfo>      <shapeType>MessageRefShape</shapeType>      <ShapeID>4aee120f-8205-411f-b3eb-9658631d87d4</ShapeID>      <ParentLink>Construct_MessageRef</ParentLink>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessageAssignmentShape</shapeType>      <ShapeID>ad8e1ad0-5ded-484b-825e-bcebc720851f</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>AssignManifestComplete</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>SendShape</shapeType>      <ShapeID>5540f757-cb4c-4b1d-9c9f-a3f22384ddab</ShapeID>      <ParentLink>ComplexStatement_Statement</ParentLink>                <shapeText>SendManifestComplete</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessageDeclarationShape</shapeType>      <ShapeID>e68547b4-e318-4ec0-83ec-4f836f9a62c6</ShapeID>      <ParentLink>Scope_MessageDeclaration</ParentLink>                <shapeText>ManifestFileMsg</shapeText>                  
<children>                </children>
  </ShapeInfo>
                            
<ShapeInfo>      <shapeType>MessageDeclarationShape</shapeType>      <ShapeID>f9d19871-1c7c-4979-89ed-2128c0825d7c</ShapeID>      <ParentLink>Scope_MessageDeclaration</ParentLink>                <shapeText>NZMetadataFileMsg</shapeText>                  
<children>                </children>
  </ShapeInfo>
                  </children>
  </ShapeInfo>
                  </children>
  </ProcessFlow>
<Metadata>

<TrkMetadata>
<ActionName>'PSCOrders'</ActionName><IsAtomic>0</IsAtomic><Line>1044</Line><Position>14</Position><ShapeID>'e211a116-cb8b-44e7-a052-0de295aa0001'</ShapeID>
</TrkMetadata>

<TrkMetadata>
<Line>1074</Line><Position>13</Position><ShapeID>'8eded03a-6b00-48a1-a114-e9e6a6db1c33'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1079</Line><Position>30</Position><ShapeID>'454f167b-bc89-49a2-a240-c926014600d1'</ShapeID>
<Messages>
	<MsgInfo><name>PscManifestMsg</name><part>Body</part><schema>PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Manifest</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<ActionName>'??__scope33'</ActionName><IsAtomic>0</IsAtomic><Line>1081</Line><Position>21</Position><ShapeID>'8c590e61-a410-4610-905a-d34d38b0bff7'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1094</Line><Position>41</Position><ShapeID>'985043b4-d731-4d68-b142-c4e600e8a461'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1108</Line><Position>30</Position><ShapeID>'b3c88acc-7060-461b-a740-f2ce582e91ef'</ShapeID>
<Messages>
	<MsgInfo><name>NZMetadataMsg</name><part>Body</part><schema>PeDALS.Schema.NZ_Metadata.MetadataExtractorPresmet</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<ActionName>'??__scope34'</ActionName><IsAtomic>0</IsAtomic><Line>1110</Line><Position>21</Position><ShapeID>'5dbe8c5b-b8dd-4b2c-935a-975ba7aff3ff'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1117</Line><Position>41</Position><ShapeID>'699b7dcf-b1c4-4f0a-bc38-e066bf3b336d'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1127</Line><Position>30</Position><ShapeID>'6edce67b-d70b-4566-9413-bbf069d18629'</ShapeID>
<Messages>
	<MsgInfo><name>PscOrdersMsg</name><part>Body</part><schema>PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Metadata</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<ActionName>'??__scope35'</ActionName><IsAtomic>0</IsAtomic><Line>1129</Line><Position>21</Position><ShapeID>'bd79e111-95a3-462b-8828-9afa05e54796'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1138</Line><Position>39</Position><ShapeID>'cdb436ae-3e11-42fb-b11f-fea274b4f5c5'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1149</Line><Position>13</Position><ShapeID>'cf0a62d0-1efe-42e5-a3ae-b01107f682b9'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<ActionName>'??__scope36'</ActionName><IsAtomic>0</IsAtomic><Line>1152</Line><Position>17</Position><ShapeID>'2f6f9914-0c7b-4ca2-a708-7459a3bae31b'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1160</Line><Position>59</Position><ShapeID>'c529251e-79a1-41b3-8f02-9cf038a59535'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1164</Line><Position>25</Position><ShapeID>'e08fd8a8-8205-466d-9022-4da8c159fd1c'</ShapeID>
<Messages>
	<MsgInfo><name>NotificationMsg</name><part>part</part><schema>Microsoft.XLANGs.BaseTypes.Any</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1171</Line><Position>25</Position><ShapeID>'b08521d4-4d29-42d4-b57c-d3f887e648fc'</ShapeID>
<Messages>
	<MsgInfo><name>NotificationMsg</name><part>part</part><schema>Microsoft.XLANGs.BaseTypes.Any</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1175</Line><Position>17</Position><ShapeID>'a9256c66-02a1-48ea-bbfd-eb71d79a5b41'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<ActionName>'Transaction_5'</ActionName><IsAtomic>0</IsAtomic><Line>1178</Line><Position>13</Position><ShapeID>'b5961eed-755f-44b6-bdd4-bf8abf85065a'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1184</Line><Position>65</Position><ShapeID>'140b02aa-fe7d-4e9c-bbdb-df85033b0544'</ShapeID>
<Messages>
	<MsgInfo><name>BaseAipMsg</name><part>Body</part><schema>PeDALS.Schema.AIP.AIPSchema</schema><direction>Out</direction></MsgInfo>
	<MsgInfo><name>NZMetadataMsg</name><part>Body</part><schema>PeDALS.Schema.NZ_Metadata.MetadataExtractorPresmet</schema><direction>In</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<ActionName>'??__scope39'</ActionName><IsAtomic>0</IsAtomic><Line>1186</Line><Position>21</Position><ShapeID>'2e8431ec-9ed6-4379-947a-3ee638b287cb'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1191</Line><Position>44</Position><ShapeID>'66e4c22e-1b51-41b3-9398-69bb3f450ee6'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1199</Line><Position>29</Position><ShapeID>'58241bd6-c432-44ab-ae1f-e2824d7b333d'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1202</Line><Position>33</Position><ShapeID>'01fec934-7d35-47a8-9edf-50d727b32f98'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1205</Line><Position>29</Position><ShapeID>'e7d65d3d-222a-45b5-b043-64272d32fc66'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1208</Line><Position>33</Position><ShapeID>'e4079179-31a6-4638-8cbc-f14258da3655'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<ActionName>'Transaction_2'</ActionName><IsAtomic>0</IsAtomic><Line>1215</Line><Position>13</Position><ShapeID>'4d178d9e-e695-4308-87bd-30236d4d2445'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1223</Line><Position>30</Position><ShapeID>'0944c685-d5ac-4482-a077-01eb8386f59a'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1225</Line><Position>21</Position><ShapeID>'fd7d317b-d1d3-41a1-96ed-38a127e7a365'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<ActionName>'??__scope40'</ActionName><IsAtomic>0</IsAtomic><Line>1228</Line><Position>25</Position><ShapeID>'bba9eb88-a980-4ff6-ae96-d71f9d4a1711'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1237</Line><Position>33</Position><ShapeID>'9eb3f1b6-1865-456d-9046-85ae90e19c39'</ShapeID>
<Messages>
	<MsgInfo><name>ManifestFileMsg</name><part>Body</part><schema>PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_File</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<ActionName>'Transaction_3'</ActionName><IsAtomic>0</IsAtomic><Line>1253</Line><Position>25</Position><ShapeID>'21600035-28ec-4bd3-8802-155b8ae13d5a'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1266</Line><Position>42</Position><ShapeID>'faeea142-4f11-4155-aac7-2357c89e1d34'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1275</Line><Position>33</Position><ShapeID>'330a93dc-2192-4f67-88b4-4d6841ccd143'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1278</Line><Position>87</Position><ShapeID>'fd452544-d07f-4c11-a64b-b8d72ac0fef1'</ShapeID>
<Messages>
	<MsgInfo><name>NZMetadataFileMsg</name><part>Body</part><schema>PeDALS.Schema.NZ_Metadata.MetadataExtractorFile</schema><direction>Out</direction></MsgInfo>
	<MsgInfo><name>NZMetadataMsg</name><part>Body</part><schema>PeDALS.Schema.NZ_Metadata.MetadataExtractorPresmet</schema><direction>In</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1280</Line><Position>37</Position><ShapeID>'c10ae42c-d7e5-41df-a4f3-8b1c98ce491d'</ShapeID>
<Messages>
	<MsgInfo><name>OrderMsg</name><part>part</part><schema>PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Order</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<ActionName>'Transaction_4'</ActionName><IsAtomic>0</IsAtomic><Line>1298</Line><Position>37</Position><ShapeID>'32c4e3b7-152d-484e-a890-4a7e765040d1'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1313</Line><Position>45</Position><ShapeID>'35003316-0b10-4d25-b77f-88eae41bb8d9'</ShapeID>
<Messages>
	<MsgInfo><name>FinalAIPMsg</name><part>Body</part><schema>PeDALS.Schema.AIP.AIPSchema</schema><direction>Out</direction></MsgInfo>
	<MsgInfo><name>BaseAipMsg</name><part>Body</part><schema>PeDALS.Schema.AIP.AIPSchema</schema><direction>In</direction></MsgInfo>
	<MsgInfo><name>OrderMsg</name><part>part</part><schema>PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Order</schema><direction>In</direction></MsgInfo>
	<MsgInfo><name>NZMetadataFileMsg</name><part>Body</part><schema>PeDALS.Schema.NZ_Metadata.MetadataExtractorFile</schema><direction>In</direction></MsgInfo>
	<MsgInfo><name>ManifestFileMsg</name><part>Body</part><schema>PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_File</schema><direction>In</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1324</Line><Position>82</Position><ShapeID>'e17ae477-e9c1-465f-b6bf-2b8bc526fe6f'</ShapeID>
<Messages>
	<MsgInfo><name>FinalAIPMsg</name><part>Body</part><schema>PeDALS.Schema.AIP.AIPSchema</schema><direction>In</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1331</Line><Position>34</Position><ShapeID>'6049336b-e3b8-4c24-8857-d60ce5ab9515'</ShapeID>
<Messages>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1334</Line><Position>21</Position><ShapeID>'69bac0fb-14e4-40b7-8607-6f95fe182b96'</ShapeID>
<Messages>
	<MsgInfo><name>ManifestCompleteMsg</name><part>part</part><schema>PeDALS.Schema.AIP.ManifestComplete</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>

<TrkMetadata>
<Line>1347</Line><Position>21</Position><ShapeID>'5540f757-cb4c-4b1d-9c9f-a3f22384ddab'</ShapeID>
<Messages>
	<MsgInfo><name>ManifestCompleteMsg</name><part>part</part><schema>PeDALS.Schema.AIP.ManifestComplete</schema><direction>Out</direction></MsgInfo>
</Messages>
</TrkMetadata>
</Metadata>
</XsymFile>";

        public override string odXml { get { return _symODXML; } }

        private const string _symODXML = @"
<?xml version='1.0' encoding='utf-8' standalone='yes'?>
<om:MetaModel MajorVersion='1' MinorVersion='3' Core='2b131234-7959-458d-834f-2dc0769ce683' ScheduleModel='66366196-361d-448d-976f-cab5e87496d2' xmlns:om='http://schemas.microsoft.com/BizTalk/2003/DesignerData'>
    <om:Element Type='Module' OID='b7e29b95-89e7-4b8f-b589-a01955136eee' LowerBound='1.1' HigherBound='358.1'>
        <om:Property Name='ReportToAnalyst' Value='True' />
        <om:Property Name='Name' Value='PeDALS.SC.Orchestrations' />
        <om:Property Name='Signal' Value='False' />
        <om:Element Type='PortType' OID='f8624d9c-92b1-4867-9d4d-a5c78ff79564' ParentLink='Module_PortType' LowerBound='16.1' HigherBound='23.1'>
            <om:Property Name='Synchronous' Value='False' />
            <om:Property Name='TypeModifier' Value='Internal' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='PSCShippingManifestPortType' />
            <om:Property Name='Signal' Value='True' />
            <om:Element Type='OperationDeclaration' OID='7b60e552-d0d3-4fd9-9596-f4f2c88378b2' ParentLink='PortType_OperationDeclaration' LowerBound='18.1' HigherBound='22.1'>
                <om:Property Name='OperationType' Value='OneWay' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='GetPSCManifest' />
                <om:Property Name='Signal' Value='True' />
                <om:Element Type='MessageRef' OID='a6531f8d-e589-4437-8007-4fbf025f2c05' ParentLink='OperationDeclaration_RequestMessageRef' LowerBound='20.13' HigherBound='20.61'>
                    <om:Property Name='Ref' Value='PeDALS.SC.Orchestrations.PublicServiceCommissionOrdersManifestMessageType' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='Request' />
                    <om:Property Name='Signal' Value='True' />
                </om:Element>
            </om:Element>
        </om:Element>
        <om:Element Type='PortType' OID='60458da3-8f78-4db3-98a6-7d062deb5dff' ParentLink='Module_PortType' LowerBound='23.1' HigherBound='30.1'>
            <om:Property Name='Synchronous' Value='False' />
            <om:Property Name='TypeModifier' Value='Internal' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='ManifestCompletePortType' />
            <om:Property Name='Signal' Value='True' />
            <om:Element Type='OperationDeclaration' OID='d1b9037e-1a97-44f5-b0ef-69647e4519c3' ParentLink='PortType_OperationDeclaration' LowerBound='25.1' HigherBound='29.1'>
                <om:Property Name='OperationType' Value='OneWay' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='Operation' />
                <om:Property Name='Signal' Value='True' />
                <om:Element Type='MessageRef' OID='fa608a55-0af8-49d6-a40f-2d2911ff8d4b' ParentLink='OperationDeclaration_RequestMessageRef' LowerBound='27.13' HigherBound='27.47'>
                    <om:Property Name='Ref' Value='PeDALS.Schema.AIP.ManifestComplete' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='Request' />
                    <om:Property Name='Signal' Value='True' />
                </om:Element>
            </om:Element>
        </om:Element>
        <om:Element Type='PortType' OID='33ee599f-2647-49a5-afbc-80425e5ebf12' ParentLink='Module_PortType' LowerBound='30.1' HigherBound='37.1'>
            <om:Property Name='Synchronous' Value='False' />
            <om:Property Name='TypeModifier' Value='Internal' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='NotificationPortType' />
            <om:Property Name='Signal' Value='True' />
            <om:Element Type='OperationDeclaration' OID='a6856399-f01c-4465-bb2e-6992b948ad63' ParentLink='PortType_OperationDeclaration' LowerBound='32.1' HigherBound='36.1'>
                <om:Property Name='OperationType' Value='OneWay' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='PublishNotification' />
                <om:Property Name='Signal' Value='True' />
                <om:Element Type='MessageRef' OID='1b84aacd-9f73-4eec-8552-886d9fa27061' ParentLink='OperationDeclaration_RequestMessageRef' LowerBound='34.13' HigherBound='34.35'>
                    <om:Property Name='Ref' Value='System.Xml.XmlDocument' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='Notification' />
                    <om:Property Name='Signal' Value='True' />
                </om:Element>
            </om:Element>
        </om:Element>
        <om:Element Type='PortType' OID='51d561d8-905d-47bc-a7b1-f3f90380e751' ParentLink='Module_PortType' LowerBound='37.1' HigherBound='44.1'>
            <om:Property Name='Synchronous' Value='False' />
            <om:Property Name='TypeModifier' Value='Internal' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='Get_PSC_Orders' />
            <om:Property Name='Signal' Value='True' />
            <om:Element Type='OperationDeclaration' OID='b7d5f38a-3d15-41d7-9310-31f93355188e' ParentLink='PortType_OperationDeclaration' LowerBound='39.1' HigherBound='43.1'>
                <om:Property Name='OperationType' Value='OneWay' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='GetPSCOrders' />
                <om:Property Name='Signal' Value='True' />
                <om:Element Type='MessageRef' OID='685d5467-e06b-47b2-ad9a-1383d16d08df' ParentLink='OperationDeclaration_RequestMessageRef' LowerBound='41.13' HigherBound='41.61'>
                    <om:Property Name='Ref' Value='PeDALS.SC.Orchestrations.PublicServiceCommissionOrdersMetadataMessageType' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='Request' />
                    <om:Property Name='Signal' Value='True' />
                </om:Element>
            </om:Element>
        </om:Element>
        <om:Element Type='ServiceDeclaration' OID='55966a76-a427-49e4-af92-0a5ff8522671' ParentLink='Module_ServiceDeclaration' LowerBound='48.1' HigherBound='357.1'>
            <om:Property Name='InitializedTransactionType' Value='True' />
            <om:Property Name='IsInvokable' Value='False' />
            <om:Property Name='TypeModifier' Value='Internal' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='PSCOrders' />
            <om:Property Name='Signal' Value='True' />
            <om:Element Type='VariableDeclaration' OID='6d82e18a-5559-477b-bd42-12e77ab66690' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='68.1' HigherBound='69.1'>
                <om:Property Name='UseDefaultConstructor' Value='True' />
                <om:Property Name='Type' Value='System.Xml.XmlDocument' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='doc' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='VariableDeclaration' OID='e27843bc-0876-45df-a301-97d555615ca6' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='69.1' HigherBound='70.1'>
                <om:Property Name='UseDefaultConstructor' Value='False' />
                <om:Property Name='Type' Value='System.Int32' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='manifestCount' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='VariableDeclaration' OID='15424fa0-b98a-454e-be7c-ab5dc11fc933' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='70.1' HigherBound='71.1'>
                <om:Property Name='UseDefaultConstructor' Value='False' />
                <om:Property Name='Type' Value='System.Int32' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='metadataCount' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='VariableDeclaration' OID='c89cf8fa-9dde-4726-9e83-0904109ed27f' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='71.1' HigherBound='72.1'>
                <om:Property Name='UseDefaultConstructor' Value='False' />
                <om:Property Name='Type' Value='System.String' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='seriesAcquisitionDir' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='VariableDeclaration' OID='5e60a89a-088c-41c6-bcfd-fda88d871889' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='72.1' HigherBound='73.1'>
                <om:Property Name='UseDefaultConstructor' Value='False' />
                <om:Property Name='Type' Value='System.Int32' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='seriesAcquisitionId' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='VariableDeclaration' OID='8b65cfc5-7147-44ec-82d4-e10b62df5b52' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='73.1' HigherBound='74.1'>
                <om:Property Name='UseDefaultConstructor' Value='False' />
                <om:Property Name='Type' Value='System.Int32' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='seriesId' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='VariableDeclaration' OID='8faa0537-2e51-41b3-ba9d-6d664c94a25d' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='74.1' HigherBound='75.1'>
                <om:Property Name='UseDefaultConstructor' Value='False' />
                <om:Property Name='Type' Value='System.String' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='superPackageId' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='VariableDeclaration' OID='2c71b95f-d2e4-4e72-8d42-750743bdc732' ParentLink='ServiceDeclaration_VariableDeclaration' LowerBound='75.1' HigherBound='76.1'>
                <om:Property Name='UseDefaultConstructor' Value='False' />
                <om:Property Name='Type' Value='System.Int32' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='orderCount' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='LongRunningTransaction' OID='749026f1-6fba-403f-b6de-aa7ff0f9c38a' ParentLink='ServiceDeclaration_Transaction' LowerBound='49.21' HigherBound='49.55'>
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='Transaction_1' />
                <om:Property Name='Signal' Value='False' />
            </om:Element>
            <om:Element Type='CorrelationDeclaration' OID='888f3187-2d2b-4ce3-9e02-6902f18dbdd8' ParentLink='ServiceDeclaration_CorrelationDeclaration' LowerBound='61.1' HigherBound='62.1'>
                <om:Property Name='Type' Value='PeDALS.SC.Orchestrations.RecvPortIdCorrelationType' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='RecvPortId' />
                <om:Property Name='Signal' Value='True' />
                <om:Element Type='StatementRef' OID='2bc431a7-c3cb-4d2f-a83d-722fec5ad024' ParentLink='CorrelationDeclaration_StatementRef' LowerBound='84.84' HigherBound='84.105'>
                    <om:Property Name='Initializes' Value='True' />
                    <om:Property Name='Ref' Value='454f167b-bc89-49a2-a240-c926014600d1' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='StatementRef_1' />
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
                <om:Element Type='StatementRef' OID='2abfdc89-2966-419b-886e-6b4a7d29e0d8' ParentLink='CorrelationDeclaration_StatementRef' LowerBound='113.101' HigherBound='113.122'>
                    <om:Property Name='Initializes' Value='True' />
                    <om:Property Name='Ref' Value='b3c88acc-7060-461b-a740-f2ce582e91ef' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='StatementRef_2' />
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
                <om:Element Type='StatementRef' OID='5950e9a8-a657-4ca2-936c-971314e5570e' ParentLink='CorrelationDeclaration_StatementRef' LowerBound='132.78' HigherBound='132.99'>
                    <om:Property Name='Initializes' Value='True' />
                    <om:Property Name='Ref' Value='6edce67b-d70b-4566-9413-bbf069d18629' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='StatementRef_3' />
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
            </om:Element>
            <om:Element Type='MessageDeclaration' OID='493fa947-8829-4b80-808f-dfd58dbe4b00' ParentLink='ServiceDeclaration_MessageDeclaration' LowerBound='62.1' HigherBound='63.1'>
                <om:Property Name='Type' Value='PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Order' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='OrderMsg' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='MessageDeclaration' OID='ba648d8a-ea14-411a-bb12-48e9ebb8eb63' ParentLink='ServiceDeclaration_MessageDeclaration' LowerBound='63.1' HigherBound='64.1'>
                <om:Property Name='Type' Value='PeDALS.SC.Orchestrations.PublicServiceCommissionOrdersManifestMessageType' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='PscManifestMsg' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='MessageDeclaration' OID='83beab83-f723-4ebe-90d1-d677f6f6646c' ParentLink='ServiceDeclaration_MessageDeclaration' LowerBound='64.1' HigherBound='65.1'>
                <om:Property Name='Type' Value='PeDALS.Orchestrations.NZMetadataMessageType' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='NZMetadataMsg' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='MessageDeclaration' OID='24231dca-8199-4faf-9268-6c0a9c481727' ParentLink='ServiceDeclaration_MessageDeclaration' LowerBound='65.1' HigherBound='66.1'>
                <om:Property Name='Type' Value='PeDALS.Orchestrations.AchivalIngestPackageMessageType' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='BaseAipMsg' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='MessageDeclaration' OID='0a44b14b-c33a-4da3-903a-21d4eeffb798' ParentLink='ServiceDeclaration_MessageDeclaration' LowerBound='66.1' HigherBound='67.1'>
                <om:Property Name='Type' Value='PeDALS.Schema.AIP.ManifestComplete' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='ManifestCompleteMsg' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='MessageDeclaration' OID='7b1acbfa-0418-40c3-bbdf-cda99db65321' ParentLink='ServiceDeclaration_MessageDeclaration' LowerBound='67.1' HigherBound='68.1'>
                <om:Property Name='Type' Value='PeDALS.SC.Orchestrations.PublicServiceCommissionOrdersMetadataMessageType' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='PscOrdersMsg' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
            <om:Element Type='ServiceBody' OID='5c3f63e2-0ae0-4d4b-945d-2a0769f1ddd7' ParentLink='ServiceDeclaration_ServiceBody'>
                <om:Property Name='Signal' Value='False' />
                <om:Element Type='Parallel' OID='8eded03a-6b00-48a1-a114-e9e6a6db1c33' ParentLink='ServiceBody_Statement' LowerBound='78.1' HigherBound='153.1'>
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='3 Messages to Start Process' />
                    <om:Property Name='Signal' Value='True' />
                    <om:Element Type='ParallelBranch' OID='7605aa75-dfa3-4dac-89d7-3f8224295729' ParentLink='ReallyComplexStatement_Branch' LowerBound='83.1' HigherBound='109.1'>
                        <om:Property Name='IsGhostBranch' Value='True' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='ParallelBranch_1' />
                        <om:Property Name='Signal' Value='False' />
                        <om:Element Type='Receive' OID='454f167b-bc89-49a2-a240-c926014600d1' ParentLink='ComplexStatement_Statement' LowerBound='83.1' HigherBound='85.1'>
                            <om:Property Name='Activate' Value='True' />
                            <om:Property Name='PortName' Value='ManifestPort' />
                            <om:Property Name='MessageName' Value='PscManifestMsg' />
                            <om:Property Name='OperationName' Value='GetPSCManifest' />
                            <om:Property Name='OperationMessageName' Value='Request' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='ReceiveShippingManifest' />
                            <om:Property Name='Signal' Value='True' />
                        </om:Element>
                        <om:Element Type='Scope' OID='8c590e61-a410-4610-905a-d34d38b0bff7' ParentLink='ComplexStatement_Statement' LowerBound='85.1' HigherBound='109.1'>
                            <om:Property Name='InitializedTransactionType' Value='True' />
                            <om:Property Name='IsSynchronized' Value='False' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='GetCountScope' />
                            <om:Property Name='Signal' Value='True' />
                            <om:Element Type='VariableAssignment' OID='985043b4-d731-4d68-b142-c4e600e8a461' ParentLink='ComplexStatement_Statement' LowerBound='92.1' HigherBound='107.1'>
                                <om:Property Name='Expression' Value='//manifestXml = PscManifestMsg.Body;&#xD;&#xA;//manifestCount = PeDALS.Utilities.XmlHelper.GetNodeCount(manifestXml, &quot;/*[local-name()=&apos;manifest&apos; and namespace-uri()=&apos;&apos;]/*[local-name()=&apos;file&apos; and namespace-uri()=&apos;&apos;]&quot;);&#xD;&#xA;&#xD;&#xA;//Divide by 2 because manifest includes XML and PDF file names&#xD;&#xA;//manifestCount = manifestCount/2;&#xD;&#xA;&#xD;&#xA;manifestXml = PscManifestMsg.Body;&#xD;&#xA;manifestCount = PeDALS.Utilities.XmlHelper.GetNodeCount(manifestXml, &quot;/*[local-name()=&apos;manifest&apos; and namespace-uri()=&apos;&apos;]/*[local-name()=&apos;file&apos; and namespace-uri()=&apos;&apos;]&quot;);&#xD;&#xA;//manifestCount = PeDALS.Utilities.XmlHelper.GetNodeCount(manifestXml, &quot;/*[local-name()=&apos;manifest&apos; and namespace-uri()=&apos;http://PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Manifest&apos;]/*[local-name()=&apos;file&apos; and namespace-uri()=&apos;&apos;]&quot;);&#xD;&#xA;&#xD;&#xA;//Minus 1 to get the count of PDF&apos;s minus the one xml file&#xD;&#xA;manifestCount = manifestCount-1;&#xD;&#xA;&#xD;&#xA;System.Diagnostics.Debug.WriteLine(&quot;Manifest Count: &quot; + System.Convert.ToString(manifestCount)); ' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='GetNodeCount' />
                                <om:Property Name='Signal' Value='False' />
                            </om:Element>
                            <om:Element Type='VariableDeclaration' OID='80fce1dc-3331-4209-8226-98789a7977c0' ParentLink='Scope_VariableDeclaration' LowerBound='88.1' HigherBound='89.1'>
                                <om:Property Name='UseDefaultConstructor' Value='True' />
                                <om:Property Name='Type' Value='System.Xml.XmlDocument' />
                                <om:Property Name='ParamDirection' Value='In' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='manifestXml' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                        </om:Element>
                    </om:Element>
                    <om:Element Type='ParallelBranch' OID='7b890436-03d9-4ede-8e62-f3b917ae5ec4' ParentLink='ReallyComplexStatement_Branch' LowerBound='112.1' HigherBound='128.1'>
                        <om:Property Name='IsGhostBranch' Value='True' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='ParallelBranch_2' />
                        <om:Property Name='Signal' Value='False' />
                        <om:Element Type='Receive' OID='b3c88acc-7060-461b-a740-f2ce582e91ef' ParentLink='ComplexStatement_Statement' LowerBound='112.1' HigherBound='114.1'>
                            <om:Property Name='Activate' Value='True' />
                            <om:Property Name='PortName' Value='NZMetadataExtractorPort' />
                            <om:Property Name='MessageName' Value='NZMetadataMsg' />
                            <om:Property Name='OperationName' Value='NZ_Metadata_Extractor' />
                            <om:Property Name='OperationMessageName' Value='request' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='ReceiveNZMetadataMsg' />
                            <om:Property Name='Signal' Value='True' />
                        </om:Element>
                        <om:Element Type='Scope' OID='5dbe8c5b-b8dd-4b2c-935a-975ba7aff3ff' ParentLink='ComplexStatement_Statement' LowerBound='114.1' HigherBound='128.1'>
                            <om:Property Name='InitializedTransactionType' Value='True' />
                            <om:Property Name='IsSynchronized' Value='False' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='GetCountScope' />
                            <om:Property Name='Signal' Value='True' />
                            <om:Element Type='VariableAssignment' OID='699b7dcf-b1c4-4f0a-bc38-e066bf3b336d' ParentLink='ComplexStatement_Statement' LowerBound='121.1' HigherBound='126.1'>
                                <om:Property Name='Expression' Value='metadataXml = NZMetadataMsg.Body;&#xD;&#xA;metadataCount = PeDALS.Utilities.XmlHelper.GetNodeCount(metadataXml, &quot;/*[local-name()=&apos;Object&apos; and namespace-uri()=&apos;&apos;]/*[local-name()=&apos;Files&apos; and namespace-uri()=&apos;&apos;]/*[local-name()=&apos;Folder&apos; and namespace-uri()=&apos;&apos;]/*[local-name()=&apos;File&apos; and namespace-uri()=&apos;&apos;]&quot;);&#xD;&#xA;&#xD;&#xA;System.Diagnostics.Debug.WriteLine(&quot;Metadata Count: &quot; + System.Convert.ToString(metadataCount)); ' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='GetNodeCount' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                            <om:Element Type='VariableDeclaration' OID='e4124ed2-054b-4660-8f49-34aa27516b72' ParentLink='Scope_VariableDeclaration' LowerBound='117.1' HigherBound='118.1'>
                                <om:Property Name='UseDefaultConstructor' Value='True' />
                                <om:Property Name='Type' Value='System.Xml.XmlDocument' />
                                <om:Property Name='ParamDirection' Value='In' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='metadataXml' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                        </om:Element>
                    </om:Element>
                    <om:Element Type='ParallelBranch' OID='2763a69c-9aa2-490a-90ef-e9407554d7cd' ParentLink='ReallyComplexStatement_Branch' LowerBound='131.1' HigherBound='151.1'>
                        <om:Property Name='IsGhostBranch' Value='True' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='ParallelBranch_3' />
                        <om:Property Name='Signal' Value='False' />
                        <om:Element Type='Receive' OID='6edce67b-d70b-4566-9413-bbf069d18629' ParentLink='ComplexStatement_Statement' LowerBound='131.1' HigherBound='133.1'>
                            <om:Property Name='Activate' Value='True' />
                            <om:Property Name='PortName' Value='OrdersPort' />
                            <om:Property Name='MessageName' Value='PscOrdersMsg' />
                            <om:Property Name='OperationName' Value='GetPSCOrders' />
                            <om:Property Name='OperationMessageName' Value='Request' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='ReceivePSCordersMsg' />
                            <om:Property Name='Signal' Value='True' />
                        </om:Element>
                        <om:Element Type='Scope' OID='bd79e111-95a3-462b-8828-9afa05e54796' ParentLink='ComplexStatement_Statement' LowerBound='133.1' HigherBound='151.1'>
                            <om:Property Name='InitializedTransactionType' Value='True' />
                            <om:Property Name='IsSynchronized' Value='False' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='GetCountScope' />
                            <om:Property Name='Signal' Value='True' />
                            <om:Element Type='VariableAssignment' OID='cdb436ae-3e11-42fb-b11f-fea274b4f5c5' ParentLink='ComplexStatement_Statement' LowerBound='140.1' HigherBound='149.1'>
                                <om:Property Name='Expression' Value='&#xD;&#xA;&#xD;&#xA;ordersXml = PscOrdersMsg.Body;&#xD;&#xA;orderCount = PeDALS.Utilities.XmlHelper.GetNodeCount(ordersXml, &quot;/*[local-name()=&apos;orders&apos; and namespace-uri()=&apos;&apos;]/*[local-name()=&apos;order&apos; and namespace-uri()=&apos;&apos;]&quot;);&#xD;&#xA;&#xD;&#xA;//OrderCount = (System.Int32) xpath(Orders_Msg, &quot;count(/*[local-name()=&apos;orders&apos; and namespace-uri()=&apos;&apos;]/*[local-name()=&apos;order&apos; and namespace-uri()=&apos;&apos;])&quot;);&#xD;&#xA;&#xD;&#xA;System.Diagnostics.Debug.WriteLine(&quot;Order Count: &quot; + System.Convert.ToString(orderCount)); ' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='GetNodeCount' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                            <om:Element Type='VariableDeclaration' OID='8496f006-0628-48c5-b4db-f3ea212b5c1a' ParentLink='Scope_VariableDeclaration' LowerBound='136.1' HigherBound='137.1'>
                                <om:Property Name='UseDefaultConstructor' Value='True' />
                                <om:Property Name='Type' Value='System.Xml.XmlDocument' />
                                <om:Property Name='ParamDirection' Value='In' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='ordersXml' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                        </om:Element>
                    </om:Element>
                </om:Element>
                <om:Element Type='Decision' OID='cf0a62d0-1efe-42e5-a3ae-b01107f682b9' ParentLink='ServiceBody_Statement' LowerBound='153.1' HigherBound='182.1'>
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='CountsMatch' />
                    <om:Property Name='Signal' Value='True' />
                    <om:Element Type='DecisionBranch' OID='a50c37d1-6d0c-4dac-9c0b-abf539c2a029' ParentLink='ReallyComplexStatement_Branch' LowerBound='154.13' HigherBound='182.1'>
                        <om:Property Name='Expression' Value='manifestCount != metadataCount &amp; manifestCount != orderCount ' />
                        <om:Property Name='IsGhostBranch' Value='True' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='No' />
                        <om:Property Name='Signal' Value='True' />
                        <om:Element Type='Scope' OID='2f6f9914-0c7b-4ca2-a708-7459a3bae31b' ParentLink='ComplexStatement_Statement' LowerBound='156.1' HigherBound='179.1'>
                            <om:Property Name='InitializedTransactionType' Value='True' />
                            <om:Property Name='IsSynchronized' Value='False' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='Notification' />
                            <om:Property Name='Signal' Value='True' />
                            <om:Element Type='VariableAssignment' OID='c529251e-79a1-41b3-8f02-9cf038a59535' ParentLink='ComplexStatement_Statement' LowerBound='164.1' HigherBound='168.1'>
                                <om:Property Name='Expression' Value='System.Diagnostics.Debug.WriteLine(&quot;Ingest counts do not match&quot;);&#xD;&#xA;System.Diagnostics.Debug.WriteLine(&quot;Throwing Exception&quot;);&#xD;&#xA;System.Diagnostics.Debug.WriteLine(&quot;##############&quot;);&#xD;&#xA;' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='DEBUG' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                            <om:Element Type='Construct' OID='e08fd8a8-8205-466d-9022-4da8c159fd1c' ParentLink='ComplexStatement_Statement' LowerBound='168.1' HigherBound='175.1'>
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='ConstructNotificationMsg' />
                                <om:Property Name='Signal' Value='True' />
                                <om:Element Type='MessageRef' OID='c6ae7d59-2398-4cd5-a4a9-ac3d72e10d29' ParentLink='Construct_MessageRef' LowerBound='169.35' HigherBound='169.50'>
                                    <om:Property Name='Ref' Value='NotificationMsg' />
                                    <om:Property Name='ReportToAnalyst' Value='True' />
                                    <om:Property Name='Signal' Value='False' />
                                </om:Element>
                                <om:Element Type='MessageAssignment' OID='0f135b4b-2bc9-419e-9d06-3d058176888e' ParentLink='ComplexStatement_Statement' LowerBound='171.1' HigherBound='174.1'>
                                    <om:Property Name='Expression' Value='NotificationMsg = new System.Xml.XmlDocument();&#xD;&#xA;NotificationMsg.LoadXml(&quot;&lt;Notification&gt;&lt;Type&gt;Warning&lt;/Type&gt;&lt;Metadata&gt;&lt;ProvenanceId&gt;&quot; + NZMetadataMsg.Body.Name + &quot;&lt;/ProvenanceId&gt;&lt;SeriesId&gt;&quot; + System.Convert.ToString(NZMetadataMsg.Body.ID) + &quot;&lt;/SeriesId&gt;&lt;SeriesAcquisitionId&gt;&quot; + System.Convert.ToString(NZMetadataMsg.Body.GroupIdentifier) + &quot;&lt;/SeriesAcquisitionId&gt;&lt;ItemId&gt;Unknown&lt;/ItemId&gt;&lt;/Metadata&gt;&lt;Message&gt;Shipping manifest and NZMetadataExtractor counts do not match.&lt;/Message&gt;&lt;/Notification&gt;&quot;);' />
                                    <om:Property Name='ReportToAnalyst' Value='False' />
                                    <om:Property Name='Name' Value='AssignNotificationMsg' />
                                    <om:Property Name='Signal' Value='True' />
                                </om:Element>
                            </om:Element>
                            <om:Element Type='Send' OID='b08521d4-4d29-42d4-b57c-d3f887e648fc' ParentLink='ComplexStatement_Statement' LowerBound='175.1' HigherBound='177.1'>
                                <om:Property Name='PortName' Value='PublishNotificationPort' />
                                <om:Property Name='MessageName' Value='NotificationMsg' />
                                <om:Property Name='OperationName' Value='PublishNotification' />
                                <om:Property Name='OperationMessageName' Value='Notification' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='SendNotification' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                            <om:Element Type='MessageDeclaration' OID='e61efaee-f1bd-4ad7-a44d-4c2e451dec57' ParentLink='Scope_MessageDeclaration' LowerBound='159.1' HigherBound='160.1'>
                                <om:Property Name='Type' Value='System.Xml.XmlDocument' />
                                <om:Property Name='ParamDirection' Value='In' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='NotificationMsg' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                            <om:Element Type='VariableDeclaration' OID='7e358bb9-91bb-4ca8-b596-75991305c248' ParentLink='Scope_VariableDeclaration' LowerBound='160.1' HigherBound='161.1'>
                                <om:Property Name='InitialValue' Value='0' />
                                <om:Property Name='UseDefaultConstructor' Value='False' />
                                <om:Property Name='Type' Value='System.Int32' />
                                <om:Property Name='ParamDirection' Value='In' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='zero' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                        </om:Element>
                        <om:Element Type='Terminate' OID='a9256c66-02a1-48ea-bbfd-eb71d79a5b41' ParentLink='ComplexStatement_Statement' LowerBound='179.1' HigherBound='181.1'>
                            <om:Property Name='ErrorMessage' Value='&quot;Terminated due to count mismatch.&quot;;' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='TerminateOnCount' />
                            <om:Property Name='Signal' Value='True' />
                        </om:Element>
                    </om:Element>
                    <om:Element Type='DecisionBranch' OID='ad2cc31d-4153-499f-a38d-9ccea54a57ed' ParentLink='ReallyComplexStatement_Branch'>
                        <om:Property Name='IsGhostBranch' Value='True' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='Else' />
                        <om:Property Name='Signal' Value='False' />
                    </om:Element>
                </om:Element>
                <om:Element Type='Scope' OID='b5961eed-755f-44b6-bdd4-bf8abf85065a' ParentLink='ServiceBody_Statement' LowerBound='182.1' HigherBound='219.1'>
                    <om:Property Name='InitializedTransactionType' Value='True' />
                    <om:Property Name='IsSynchronized' Value='False' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='InitialValuesScope' />
                    <om:Property Name='Signal' Value='True' />
                    <om:Element Type='Call' OID='140b02aa-fe7d-4e9c-bbdb-df85033b0544' ParentLink='ComplexStatement_Statement' LowerBound='188.1' HigherBound='190.1'>
                        <om:Property Name='Identifier' Value='GetInitialValues' />
                        <om:Property Name='Invokee' Value='PeDALS.Orchestrations.GetInitialValues' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='GetInitialValues' />
                        <om:Property Name='Signal' Value='False' />
                        <om:Element Type='Parameter' OID='c8ecf617-7b28-4da6-8985-d1a94a8d55b7' ParentLink='InvokeStatement_Parameter'>
                            <om:Property Name='Direction' Value='Out' />
                            <om:Property Name='Name' Value='BaseAipMsg' />
                            <om:Property Name='Type' Value='PeDALS.Orchestrations.AchivalIngestPackageMessageType' />
                            <om:Property Name='Signal' Value='False' />
                        </om:Element>
                        <om:Element Type='Parameter' OID='31528624-d200-4a4c-98ad-7fd6e9960af4' ParentLink='InvokeStatement_Parameter'>
                            <om:Property Name='Direction' Value='In' />
                            <om:Property Name='Name' Value='NZMetadataMsg' />
                            <om:Property Name='Type' Value='PeDALS.Orchestrations.NZMetadataMessageType' />
                            <om:Property Name='Signal' Value='False' />
                        </om:Element>
                    </om:Element>
                    <om:Element Type='Scope' OID='2e8431ec-9ed6-4379-947a-3ee638b287cb' ParentLink='ComplexStatement_Statement' LowerBound='190.1' HigherBound='217.1'>
                        <om:Property Name='InitializedTransactionType' Value='True' />
                        <om:Property Name='IsSynchronized' Value='False' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='ScopeGetItem' />
                        <om:Property Name='Signal' Value='True' />
                        <om:Element Type='VariableAssignment' OID='66e4c22e-1b51-41b3-9398-69bb3f450ee6' ParentLink='ComplexStatement_Statement' LowerBound='195.1' HigherBound='200.1'>
                            <om:Property Name='Expression' Value='superPackageId = BaseAipMsg.Body.SuperPackageId;&#xD;&#xA;seriesId = BaseAipMsg.Body.CoreMetadata.Provenance.Series.SeriesId;&#xD;&#xA;seriesAcquisitionId = BaseAipMsg.Body.CoreMetadata.Provenance.Series.Acquisition.SeriesAcquisitionId;&#xD;&#xA;seriesAcquisitionDir = BaseAipMsg.Body.CoreMetadata.Provenance.Series.Acquisition.SeriesAcquisitionDirectory;&#xD;&#xA;' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='SetVariables' />
                            <om:Property Name='Signal' Value='False' />
                        </om:Element>
                        <om:Element Type='Catch' OID='58241bd6-c432-44ab-ae1f-e2824d7b333d' ParentLink='Scope_Catch' LowerBound='203.1' HigherBound='209.1'>
                            <om:Property Name='ExceptionName' Value='ex' />
                            <om:Property Name='ExceptionType' Value='System.NullReferenceException' />
                            <om:Property Name='IsFaultMessage' Value='False' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='CatchNullRef' />
                            <om:Property Name='Signal' Value='True' />
                            <om:Element Type='VariableAssignment' OID='01fec934-7d35-47a8-9edf-50d727b32f98' ParentLink='Catch_Statement' LowerBound='206.1' HigherBound='208.1'>
                                <om:Property Name='Expression' Value='throw new System.ApplicationException(&quot;Missing data returned from database.  ItemId and SourcePath could not be set.  Are you sure the ProvenanceId, SeriesId, and SeriesAcquisitionId exists?&quot;, ex);' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='ThrowSpecific' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                        </om:Element>
                        <om:Element Type='Catch' OID='e7d65d3d-222a-45b5-b043-64272d32fc66' ParentLink='Scope_Catch' LowerBound='209.1' HigherBound='215.1'>
                            <om:Property Name='ExceptionName' Value='ex' />
                            <om:Property Name='ExceptionType' Value='System.InvalidCastException' />
                            <om:Property Name='IsFaultMessage' Value='False' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='CatchCastException' />
                            <om:Property Name='Signal' Value='True' />
                            <om:Element Type='VariableAssignment' OID='e4079179-31a6-4638-8cbc-f14258da3655' ParentLink='Catch_Statement' LowerBound='212.1' HigherBound='214.1'>
                                <om:Property Name='Expression' Value='throw new System.ApplicationException(&quot;Malformed data.  Is series acquisition id in an integer format?&quot;, ex);' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='ThrowSpecific' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                        </om:Element>
                    </om:Element>
                    <om:Element Type='MessageDeclaration' OID='e7e33663-da78-4843-80bc-5afa9bda7dac' ParentLink='Scope_MessageDeclaration' LowerBound='185.1' HigherBound='186.1'>
                        <om:Property Name='Type' Value='PeDALS.Orchestrations.GetInitialValuesResponseMessageType' />
                        <om:Property Name='ParamDirection' Value='In' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='GetInitialValuesResponseMsg' />
                        <om:Property Name='Signal' Value='True' />
                    </om:Element>
                    <om:Element Type='LongRunningTransaction' OID='829da783-748f-4508-87e0-c3b5e2940e4a' ParentLink='Scope_Transaction' LowerBound='183.18' HigherBound='183.56'>
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='Transaction_5' />
                        <om:Property Name='Signal' Value='False' />
                    </om:Element>
                </om:Element>
                <om:Element Type='Scope' OID='4d178d9e-e695-4308-87bd-30236d4d2445' ParentLink='ServiceBody_Statement' LowerBound='219.1' HigherBound='355.1'>
                    <om:Property Name='InitializedTransactionType' Value='True' />
                    <om:Property Name='IsSynchronized' Value='False' />
                    <om:Property Name='ReportToAnalyst' Value='True' />
                    <om:Property Name='Name' Value='SplitFiles' />
                    <om:Property Name='Signal' Value='True' />
                    <om:Element Type='VariableDeclaration' OID='bd2721a2-213d-428b-9196-fa134fc9417f' ParentLink='Scope_VariableDeclaration' LowerBound='224.1' HigherBound='225.1'>
                        <om:Property Name='UseDefaultConstructor' Value='False' />
                        <om:Property Name='Type' Value='System.Int32' />
                        <om:Property Name='ParamDirection' Value='In' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='recCount' />
                        <om:Property Name='Signal' Value='True' />
                    </om:Element>
                    <om:Element Type='LongRunningTransaction' OID='cf1cee1e-8874-4241-8a2b-2ebfb80d1a5a' ParentLink='Scope_Transaction' LowerBound='220.18' HigherBound='220.56'>
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='Transaction_2' />
                        <om:Property Name='Signal' Value='False' />
                    </om:Element>
                    <om:Element Type='VariableAssignment' OID='0944c685-d5ac-4482-a077-01eb8386f59a' ParentLink='ComplexStatement_Statement' LowerBound='227.1' HigherBound='229.1'>
                        <om:Property Name='Expression' Value='recCount = 1;' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='GetRecordCount' />
                        <om:Property Name='Signal' Value='True' />
                    </om:Element>
                    <om:Element Type='While' OID='fd7d317b-d1d3-41a1-96ed-38a127e7a365' ParentLink='ComplexStatement_Statement' LowerBound='229.1' HigherBound='338.1'>
                        <om:Property Name='Expression' Value='recCount &lt;= manifestCount + 1' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='LoopMultipleFile' />
                        <om:Property Name='Signal' Value='False' />
                        <om:Element Type='Scope' OID='bba9eb88-a980-4ff6-ae96-d71f9d4a1711' ParentLink='ComplexStatement_Statement' LowerBound='232.1' HigherBound='257.1'>
                            <om:Property Name='InitializedTransactionType' Value='True' />
                            <om:Property Name='IsSynchronized' Value='False' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='SplitManifestScope' />
                            <om:Property Name='Signal' Value='True' />
                            <om:Element Type='Construct' OID='9eb3f1b6-1865-456d-9046-85ae90e19c39' ParentLink='ComplexStatement_Statement' LowerBound='241.1' HigherBound='255.1'>
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='ConstructFileMsg' />
                                <om:Property Name='Signal' Value='True' />
                                <om:Element Type='MessageAssignment' OID='ee5333c1-b52d-4a87-9173-9c24f3d54fec' ParentLink='ComplexStatement_Statement' LowerBound='244.1' HigherBound='254.1'>
                                    <om:Property Name='Expression' Value='xmlManifest = PscManifestMsg.Body;&#xD;&#xA;xmlTemp = PeDALS.Utilities.XmlHelper.GetNodeAsXML(xmlManifest, &quot;/*[local-name()=&apos;manifest&apos; and namespace-uri()=&apos;&apos;]/*[local-name()=&apos;file&apos; and namespace-uri()=&apos;&apos;][&quot; + System.Convert.ToString(recCount) + &quot;]&quot;);&#xD;&#xA;//xmlTemp = PeDALS.Utilities.XmlHelper.GetNodeAsXML(xmlManifest, &quot;/*[local-name()=&apos;manifest&apos; and namespace-uri()=&apos;http://PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Manifest&apos;]/*[local-name()=&apos;file&apos; and namespace-uri()=&apos;&apos;][&quot; + System.Convert.ToString(recCount) + &quot;]&quot;);&#xD;&#xA;//DELETE ME&#xD;&#xA;System.Diagnostics.Debug.WriteLine(&quot;Single Manifest File&quot;);&#xD;&#xA;System.Diagnostics.Debug.WriteLine(xmlTemp.OuterXml);&#xD;&#xA;System.Diagnostics.Debug.WriteLine(&quot;!!!!!!!!!!!!!!!!!!!!!!&quot;);&#xD;&#xA;&#xD;&#xA;ManifestFileMsg.Body = xmlTemp;' />
                                    <om:Property Name='ReportToAnalyst' Value='False' />
                                    <om:Property Name='Name' Value='AssignFileMsg' />
                                    <om:Property Name='Signal' Value='True' />
                                </om:Element>
                                <om:Element Type='MessageRef' OID='8b4d632e-5090-4a10-9e41-dcf5b1bb08dc' ParentLink='Construct_MessageRef' LowerBound='242.43' HigherBound='242.58'>
                                    <om:Property Name='Ref' Value='ManifestFileMsg' />
                                    <om:Property Name='ReportToAnalyst' Value='True' />
                                    <om:Property Name='Signal' Value='False' />
                                </om:Element>
                            </om:Element>
                            <om:Element Type='VariableDeclaration' OID='6f3c8b24-c7f8-4ad7-92b1-71d8dce1d9b5' ParentLink='Scope_VariableDeclaration' LowerBound='235.1' HigherBound='236.1'>
                                <om:Property Name='UseDefaultConstructor' Value='True' />
                                <om:Property Name='Type' Value='System.Xml.XmlDocument' />
                                <om:Property Name='ParamDirection' Value='In' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='xmlManifest' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                            <om:Element Type='VariableDeclaration' OID='a07882a1-b104-44e9-804d-8c381c00cd71' ParentLink='Scope_VariableDeclaration' LowerBound='236.1' HigherBound='237.1'>
                                <om:Property Name='UseDefaultConstructor' Value='True' />
                                <om:Property Name='Type' Value='System.Xml.XmlDocument' />
                                <om:Property Name='ParamDirection' Value='In' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='xmlTemp' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                        </om:Element>
                        <om:Element Type='Scope' OID='21600035-28ec-4bd3-8802-155b8ae13d5a' ParentLink='ComplexStatement_Statement' LowerBound='257.1' HigherBound='335.1'>
                            <om:Property Name='InitializedTransactionType' Value='True' />
                            <om:Property Name='IsSynchronized' Value='False' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='SplitNZMetadata' />
                            <om:Property Name='Signal' Value='True' />
                            <om:Element Type='VariableAssignment' OID='faeea142-4f11-4155-aac7-2357c89e1d34' ParentLink='ComplexStatement_Statement' LowerBound='270.1' HigherBound='279.1'>
                                <om:Property Name='Expression' Value='fileName = ManifestFileMsg.Body.filename;&#xD;&#xA;&#xD;&#xA;//DELETE ME&#xD;&#xA;System.Diagnostics.Debug.WriteLine(&quot;Next File to Work with&quot;);&#xD;&#xA;System.Diagnostics.Debug.WriteLine(fileName);&#xD;&#xA;System.Diagnostics.Debug.WriteLine(&quot;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&quot;);&#xD;&#xA;&#xD;&#xA;projType = &quot;Cert&quot;;' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='SetFileName' />
                                <om:Property Name='Signal' Value='False' />
                            </om:Element>
                            <om:Element Type='Decision' OID='330a93dc-2192-4f67-88b4-4d6841ccd143' ParentLink='ComplexStatement_Statement' LowerBound='279.1' HigherBound='333.1'>
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='IsPDF' />
                                <om:Property Name='Signal' Value='True' />
                                <om:Element Type='DecisionBranch' OID='1aefdd2b-f2f4-43dc-ae65-29e95be95e98' ParentLink='ReallyComplexStatement_Branch' LowerBound='280.33' HigherBound='333.1'>
                                    <om:Property Name='Expression' Value='fileName.EndsWith(&quot;.pdf&quot;)' />
                                    <om:Property Name='IsGhostBranch' Value='True' />
                                    <om:Property Name='ReportToAnalyst' Value='True' />
                                    <om:Property Name='Name' Value='Yes' />
                                    <om:Property Name='Signal' Value='True' />
                                    <om:Element Type='Call' OID='fd452544-d07f-4c11-a64b-b8d72ac0fef1' ParentLink='ComplexStatement_Statement' LowerBound='282.1' HigherBound='284.1'>
                                        <om:Property Name='Identifier' Value='SplitNZMetadata' />
                                        <om:Property Name='Invokee' Value='PeDALS.Orchestrations.SplitNZMetadataMessage' />
                                        <om:Property Name='ReportToAnalyst' Value='True' />
                                        <om:Property Name='Name' Value='SplitNZMetadataMessage' />
                                        <om:Property Name='Signal' Value='False' />
                                        <om:Element Type='Parameter' OID='d5d2c5b5-8be8-4b03-9799-a874ccb80bb3' ParentLink='InvokeStatement_Parameter'>
                                            <om:Property Name='Direction' Value='Out' />
                                            <om:Property Name='Name' Value='NZMetadataFileMsg' />
                                            <om:Property Name='Type' Value='PeDALS.Orchestrations.NZMetadataFileMessageType' />
                                            <om:Property Name='Signal' Value='False' />
                                        </om:Element>
                                        <om:Element Type='Parameter' OID='59fe3508-c677-4a64-a55f-590a537298b1' ParentLink='InvokeStatement_Parameter'>
                                            <om:Property Name='Direction' Value='In' />
                                            <om:Property Name='Name' Value='NZMetadataMsg' />
                                            <om:Property Name='Type' Value='PeDALS.Orchestrations.NZMetadataMessageType' />
                                            <om:Property Name='Signal' Value='False' />
                                        </om:Element>
                                        <om:Element Type='Parameter' OID='8cfa467c-7627-4e75-9684-2b278f6a4bfc' ParentLink='InvokeStatement_Parameter'>
                                            <om:Property Name='Direction' Value='In' />
                                            <om:Property Name='Name' Value='fileName' />
                                            <om:Property Name='Type' Value='System.String' />
                                            <om:Property Name='Signal' Value='False' />
                                        </om:Element>
                                    </om:Element>
                                    <om:Element Type='Construct' OID='c10ae42c-d7e5-41df-a4f3-8b1c98ce491d' ParentLink='ComplexStatement_Statement' LowerBound='284.1' HigherBound='302.1'>
                                        <om:Property Name='ReportToAnalyst' Value='True' />
                                        <om:Property Name='Name' Value='ConstructMessage_1' />
                                        <om:Property Name='Signal' Value='True' />
                                        <om:Element Type='MessageAssignment' OID='9392fdb7-23bd-44be-bd85-a312fff77d47' ParentLink='ComplexStatement_Statement' LowerBound='287.1' HigherBound='301.1'>
                                            <om:Property Name='Expression' Value='fileName = fileName.Replace(&quot;data/&quot;,&quot;&quot;);&#xD;&#xA;&#xD;&#xA;xmlOrderMsg = PscOrdersMsg.Body;  &#xD;&#xA;tempXML = PeDALS.Utilities.XmlHelper.GetNodeAsXML(xmlOrderMsg, &quot;//order[order_attachment=&apos;&quot; + fileName + &quot;&apos;]&quot;);&#xD;&#xA;&#xD;&#xA;//DELETE ME&#xD;&#xA;System.Diagnostics.Debug.WriteLine(&quot;Indvidual NZ Metadata File&quot;);&#xD;&#xA;System.Diagnostics.Debug.WriteLine(tempXML.OuterXml);&#xD;&#xA;System.Diagnostics.Debug.WriteLine(&quot;**************************&quot;);&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;//NZMetadataFileMsg.Body = xmlTemp;&#xD;&#xA;OrderMsg = tempXML; ' />
                                            <om:Property Name='ReportToAnalyst' Value='False' />
                                            <om:Property Name='Name' Value='MessageAssignment_1' />
                                            <om:Property Name='Signal' Value='False' />
                                        </om:Element>
                                        <om:Element Type='MessageRef' OID='6b913b94-0318-4047-81ac-696c78c208a1' ParentLink='Construct_MessageRef' LowerBound='285.47' HigherBound='285.55'>
                                            <om:Property Name='Ref' Value='OrderMsg' />
                                            <om:Property Name='ReportToAnalyst' Value='True' />
                                            <om:Property Name='Signal' Value='False' />
                                        </om:Element>
                                    </om:Element>
                                    <om:Element Type='Scope' OID='32c4e3b7-152d-484e-a890-4a7e765040d1' ParentLink='ComplexStatement_Statement' LowerBound='302.1' HigherBound='332.1'>
                                        <om:Property Name='InitializedTransactionType' Value='True' />
                                        <om:Property Name='IsSynchronized' Value='False' />
                                        <om:Property Name='ReportToAnalyst' Value='True' />
                                        <om:Property Name='Name' Value='CreateFinalAIPScope' />
                                        <om:Property Name='Signal' Value='True' />
                                        <om:Element Type='Construct' OID='35003316-0b10-4d25-b77f-88eae41bb8d9' ParentLink='ComplexStatement_Statement' LowerBound='317.1' HigherBound='328.1'>
                                            <om:Property Name='ReportToAnalyst' Value='True' />
                                            <om:Property Name='Name' Value='ConstructFinalAIP' />
                                            <om:Property Name='Signal' Value='True' />
                                            <om:Element Type='MessageRef' OID='1b948714-c334-4244-b264-f4e28b1a3d82' ParentLink='Construct_MessageRef' LowerBound='318.55' HigherBound='318.66'>
                                                <om:Property Name='Ref' Value='FinalAIPMsg' />
                                                <om:Property Name='ReportToAnalyst' Value='True' />
                                                <om:Property Name='Signal' Value='False' />
                                            </om:Element>
                                            <om:Element Type='Transform' OID='50881a4b-2c7d-4516-bf6e-7767945d0ec1' ParentLink='ComplexStatement_Statement' LowerBound='320.1' HigherBound='322.1'>
                                                <om:Property Name='ClassName' Value='PeDALS.SC.Orchestrations.TransformBaseAipOrgMetadata_NZMetadataToFinalAIP' />
                                                <om:Property Name='ReportToAnalyst' Value='True' />
                                                <om:Property Name='Name' Value='TransformBaseAipOrgMetadata_NZMetadataToFinalAIP' />
                                                <om:Property Name='Signal' Value='True' />
                                                <om:Element Type='MessagePartRef' OID='1e4bbd42-6cfe-4dfc-9855-35e0636f09d3' ParentLink='Transform_InputMessagePartRef' LowerBound='321.155' HigherBound='321.170'>
                                                    <om:Property Name='MessageRef' Value='BaseAipMsg' />
                                                    <om:Property Name='PartRef' Value='Body' />
                                                    <om:Property Name='ReportToAnalyst' Value='True' />
                                                    <om:Property Name='Name' Value='MessagePartReference_1' />
                                                    <om:Property Name='Signal' Value='False' />
                                                </om:Element>
                                                <om:Element Type='MessagePartRef' OID='230b8e11-62b0-48a3-b64e-a74c3e6ab32b' ParentLink='Transform_InputMessagePartRef' LowerBound='321.172' HigherBound='321.180'>
                                                    <om:Property Name='MessageRef' Value='OrderMsg' />
                                                    <om:Property Name='ReportToAnalyst' Value='True' />
                                                    <om:Property Name='Name' Value='MessagePartReference_2' />
                                                    <om:Property Name='Signal' Value='False' />
                                                </om:Element>
                                                <om:Element Type='MessagePartRef' OID='5e39f309-5e3d-42ca-afe3-52d649a5b1cc' ParentLink='Transform_InputMessagePartRef' LowerBound='321.182' HigherBound='321.204'>
                                                    <om:Property Name='MessageRef' Value='NZMetadataFileMsg' />
                                                    <om:Property Name='PartRef' Value='Body' />
                                                    <om:Property Name='ReportToAnalyst' Value='True' />
                                                    <om:Property Name='Name' Value='MessagePartReference_3' />
                                                    <om:Property Name='Signal' Value='False' />
                                                </om:Element>
                                                <om:Element Type='MessagePartRef' OID='732a2207-db8c-4ae4-b94a-fccf4aee9d5d' ParentLink='Transform_InputMessagePartRef' LowerBound='321.206' HigherBound='321.226'>
                                                    <om:Property Name='MessageRef' Value='ManifestFileMsg' />
                                                    <om:Property Name='PartRef' Value='Body' />
                                                    <om:Property Name='ReportToAnalyst' Value='True' />
                                                    <om:Property Name='Name' Value='MessagePartReference_5' />
                                                    <om:Property Name='Signal' Value='False' />
                                                </om:Element>
                                                <om:Element Type='MessagePartRef' OID='a0778fe3-8834-4c5f-8a93-fd47d4415d7f' ParentLink='Transform_OutputMessagePartRef' LowerBound='321.60' HigherBound='321.76'>
                                                    <om:Property Name='MessageRef' Value='FinalAIPMsg' />
                                                    <om:Property Name='PartRef' Value='Body' />
                                                    <om:Property Name='ReportToAnalyst' Value='True' />
                                                    <om:Property Name='Name' Value='MessagePartReference_4' />
                                                    <om:Property Name='Signal' Value='False' />
                                                </om:Element>
                                            </om:Element>
                                            <om:Element Type='MessageAssignment' OID='817e4d76-bcf3-463e-9e52-f410eeb386a0' ParentLink='ComplexStatement_Statement' LowerBound='322.1' HigherBound='327.1'>
                                                <om:Property Name='Expression' Value='&#xD;&#xA;orgFileAsBase64 = PeDALS.Utilities.Base64.Encode.PdfFile(seriesAcquisitionDir + &quot;\\Data\\&quot; + fileName);&#xD;&#xA;xpath(FinalAIPMsg.Body, &quot;/*[local-name()=&apos;AIP&apos; and namespace-uri()=&apos;http://PeDALS&apos;]/*[local-name()=&apos;OriginalMetadata&apos; and namespace-uri()=&apos;&apos;]&quot;) = xmlTemp.OuterXml;&#xD;&#xA;xpath(FinalAIPMsg.Body, &quot;/*[local-name()=&apos;AIP&apos; and namespace-uri()=&apos;http://PeDALS&apos;]/*[local-name()=&apos;OriginalRecord&apos; and namespace-uri()=&apos;&apos;]&quot;) = orgFileAsBase64;&#xD;&#xA;' />
                                                <om:Property Name='ReportToAnalyst' Value='False' />
                                                <om:Property Name='Name' Value='AddAdditionalInformation' />
                                                <om:Property Name='Signal' Value='False' />
                                            </om:Element>
                                        </om:Element>
                                        <om:Element Type='Call' OID='e17ae477-e9c1-465f-b6bf-2b8bc526fe6f' ParentLink='ComplexStatement_Statement' LowerBound='328.1' HigherBound='330.1'>
                                            <om:Property Name='Identifier' Value='CallInsertAip' />
                                            <om:Property Name='Invokee' Value='PeDALS.Orchestrations.InsertAIP' />
                                            <om:Property Name='ReportToAnalyst' Value='True' />
                                            <om:Property Name='Name' Value='CallInsertAip' />
                                            <om:Property Name='Signal' Value='True' />
                                            <om:Element Type='Parameter' OID='9637aa98-557b-4a01-9fac-ab72ffcb9d9e' ParentLink='InvokeStatement_Parameter'>
                                                <om:Property Name='Direction' Value='In' />
                                                <om:Property Name='Name' Value='FinalAIPMsg' />
                                                <om:Property Name='Type' Value='PeDALS.Orchestrations.AchivalIngestPackageMessageType' />
                                                <om:Property Name='Signal' Value='False' />
                                            </om:Element>
                                        </om:Element>
                                        <om:Element Type='VariableDeclaration' OID='759d809e-d737-473f-884e-e9863becdf7e' ParentLink='Scope_VariableDeclaration' LowerBound='307.1' HigherBound='308.1'>
                                            <om:Property Name='UseDefaultConstructor' Value='False' />
                                            <om:Property Name='Type' Value='System.String' />
                                            <om:Property Name='ParamDirection' Value='In' />
                                            <om:Property Name='ReportToAnalyst' Value='True' />
                                            <om:Property Name='Name' Value='orgFileAsBase64' />
                                            <om:Property Name='Signal' Value='True' />
                                        </om:Element>
                                        <om:Element Type='VariableDeclaration' OID='84dcd552-b6a3-4568-a389-078196ca1c57' ParentLink='Scope_VariableDeclaration' LowerBound='308.1' HigherBound='309.1'>
                                            <om:Property Name='UseDefaultConstructor' Value='False' />
                                            <om:Property Name='Type' Value='System.String' />
                                            <om:Property Name='ParamDirection' Value='In' />
                                            <om:Property Name='ReportToAnalyst' Value='True' />
                                            <om:Property Name='Name' Value='temp' />
                                            <om:Property Name='Signal' Value='True' />
                                        </om:Element>
                                        <om:Element Type='VariableDeclaration' OID='e7c07206-9f45-4992-9ed1-dd59b70c951d' ParentLink='Scope_VariableDeclaration' LowerBound='309.1' HigherBound='310.1'>
                                            <om:Property Name='UseDefaultConstructor' Value='False' />
                                            <om:Property Name='Type' Value='System.String' />
                                            <om:Property Name='ParamDirection' Value='In' />
                                            <om:Property Name='ReportToAnalyst' Value='True' />
                                            <om:Property Name='Name' Value='title' />
                                            <om:Property Name='Signal' Value='True' />
                                        </om:Element>
                                        <om:Element Type='VariableDeclaration' OID='1969b2c9-44a9-4ac9-a5ad-90fe83872625' ParentLink='Scope_VariableDeclaration' LowerBound='310.1' HigherBound='311.1'>
                                            <om:Property Name='UseDefaultConstructor' Value='True' />
                                            <om:Property Name='Type' Value='System.Xml.XmlDocument' />
                                            <om:Property Name='ParamDirection' Value='In' />
                                            <om:Property Name='ReportToAnalyst' Value='True' />
                                            <om:Property Name='Name' Value='xmlTemp' />
                                            <om:Property Name='Signal' Value='True' />
                                        </om:Element>
                                        <om:Element Type='MessageDeclaration' OID='ff9d893d-01b7-4e9b-8634-d194dbb17a34' ParentLink='Scope_MessageDeclaration' LowerBound='305.1' HigherBound='306.1'>
                                            <om:Property Name='Type' Value='PeDALS.Orchestrations.AchivalIngestPackageMessageType' />
                                            <om:Property Name='ParamDirection' Value='In' />
                                            <om:Property Name='ReportToAnalyst' Value='True' />
                                            <om:Property Name='Name' Value='FinalAIPMsg' />
                                            <om:Property Name='Signal' Value='True' />
                                        </om:Element>
                                        <om:Element Type='MessageDeclaration' OID='2bba772b-2785-4639-a492-0a0109e2450a' ParentLink='Scope_MessageDeclaration' LowerBound='306.1' HigherBound='307.1'>
                                            <om:Property Name='Type' Value='PeDALS.SC.Orchestrations.PublicServiceCommissionOrdersMetadataMessageType' />
                                            <om:Property Name='ParamDirection' Value='In' />
                                            <om:Property Name='ReportToAnalyst' Value='True' />
                                            <om:Property Name='Name' Value='OrgMetadataMsg' />
                                            <om:Property Name='Signal' Value='True' />
                                        </om:Element>
                                        <om:Element Type='LongRunningTransaction' OID='f8e675ef-32e3-4f0e-802a-42527214234d' ParentLink='Scope_Transaction' LowerBound='303.42' HigherBound='303.80'>
                                            <om:Property Name='ReportToAnalyst' Value='True' />
                                            <om:Property Name='Name' Value='Transaction_4' />
                                            <om:Property Name='Signal' Value='False' />
                                        </om:Element>
                                    </om:Element>
                                </om:Element>
                                <om:Element Type='DecisionBranch' OID='2cdc45ea-3fbc-4780-a64b-07f3f2186d58' ParentLink='ReallyComplexStatement_Branch'>
                                    <om:Property Name='IsGhostBranch' Value='True' />
                                    <om:Property Name='ReportToAnalyst' Value='True' />
                                    <om:Property Name='Name' Value='Else' />
                                    <om:Property Name='Signal' Value='False' />
                                </om:Element>
                            </om:Element>
                            <om:Element Type='VariableDeclaration' OID='ece91c8e-1a6c-43d8-a7d9-67c358b9bd35' ParentLink='Scope_VariableDeclaration' LowerBound='260.1' HigherBound='261.1'>
                                <om:Property Name='UseDefaultConstructor' Value='False' />
                                <om:Property Name='Type' Value='System.String' />
                                <om:Property Name='ParamDirection' Value='In' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='fileName' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                            <om:Element Type='VariableDeclaration' OID='7084a108-67a7-4e4b-b211-82e40b341fe4' ParentLink='Scope_VariableDeclaration' LowerBound='261.1' HigherBound='262.1'>
                                <om:Property Name='UseDefaultConstructor' Value='False' />
                                <om:Property Name='Type' Value='System.String' />
                                <om:Property Name='ParamDirection' Value='In' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='projType' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                            <om:Element Type='VariableDeclaration' OID='df170316-7932-4df9-bf09-91040c51c499' ParentLink='Scope_VariableDeclaration' LowerBound='262.1' HigherBound='263.1'>
                                <om:Property Name='UseDefaultConstructor' Value='True' />
                                <om:Property Name='Type' Value='System.Xml.XmlDocument' />
                                <om:Property Name='ParamDirection' Value='In' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='xmlOrderMsg' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                            <om:Element Type='VariableDeclaration' OID='051da556-2b65-44c0-9df6-bdc8c964c339' ParentLink='Scope_VariableDeclaration' LowerBound='263.1' HigherBound='264.1'>
                                <om:Property Name='UseDefaultConstructor' Value='True' />
                                <om:Property Name='Type' Value='System.Xml.XmlDocument' />
                                <om:Property Name='ParamDirection' Value='In' />
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='tempXML' />
                                <om:Property Name='Signal' Value='True' />
                            </om:Element>
                            <om:Element Type='LongRunningTransaction' OID='d002e7af-09c4-4dd7-b0e4-252716c0d9ea' ParentLink='Scope_Transaction' LowerBound='258.30' HigherBound='258.68'>
                                <om:Property Name='ReportToAnalyst' Value='True' />
                                <om:Property Name='Name' Value='Transaction_3' />
                                <om:Property Name='Signal' Value='False' />
                            </om:Element>
                        </om:Element>
                        <om:Element Type='VariableAssignment' OID='6049336b-e3b8-4c24-8857-d60ce5ab9515' ParentLink='ComplexStatement_Statement' LowerBound='335.1' HigherBound='337.1'>
                            <om:Property Name='Expression' Value='recCount = recCount + 1;&#xD;&#xA;' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Name' Value='IncrementRecordCount' />
                            <om:Property Name='Signal' Value='True' />
                        </om:Element>
                    </om:Element>
                    <om:Element Type='Construct' OID='69bac0fb-14e4-40b7-8607-6f95fe182b96' ParentLink='ComplexStatement_Statement' LowerBound='338.1' HigherBound='351.1'>
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='ConstructManifestComplete' />
                        <om:Property Name='Signal' Value='True' />
                        <om:Element Type='MessageRef' OID='4aee120f-8205-411f-b3eb-9658631d87d4' ParentLink='Construct_MessageRef' LowerBound='339.31' HigherBound='339.50'>
                            <om:Property Name='Ref' Value='ManifestCompleteMsg' />
                            <om:Property Name='ReportToAnalyst' Value='True' />
                            <om:Property Name='Signal' Value='False' />
                        </om:Element>
                        <om:Element Type='MessageAssignment' OID='ad8e1ad0-5ded-484b-825e-bcebc720851f' ParentLink='ComplexStatement_Statement' LowerBound='341.1' HigherBound='350.1'>
                            <om:Property Name='Expression' Value='doc = new System.Xml.XmlDocument();&#xD;&#xA;doc.LoadXml(&quot;&lt;ns0:Manifest xmlns:ns0=\&quot;http://PeDALS.Schema\&quot;&quot;&#xD;&#xA;            + &quot; SeriesAcquisitionId=\&quot;&quot; + seriesAcquisitionId.ToString() + &quot;\&quot;&quot;&#xD;&#xA;            + &quot; SeriesId=\&quot;&quot; + seriesId.ToString() + &quot;\&quot;&quot;&#xD;&#xA;            + &quot; SuperPackageId=\&quot;&quot; + superPackageId + &quot;\&quot;&quot;&#xD;&#xA;            + &quot; SeriesAcquisitionDir=\&quot;&quot; + seriesAcquisitionDir + &quot;\&quot;/&gt;&quot;);&#xD;&#xA;&#xD;&#xA;ManifestCompleteMsg = doc;&#xD;&#xA;' />
                            <om:Property Name='ReportToAnalyst' Value='False' />
                            <om:Property Name='Name' Value='AssignManifestComplete' />
                            <om:Property Name='Signal' Value='False' />
                        </om:Element>
                    </om:Element>
                    <om:Element Type='Send' OID='5540f757-cb4c-4b1d-9c9f-a3f22384ddab' ParentLink='ComplexStatement_Statement' LowerBound='351.1' HigherBound='353.1'>
                        <om:Property Name='PortName' Value='ManifestCompletePort' />
                        <om:Property Name='MessageName' Value='ManifestCompleteMsg' />
                        <om:Property Name='OperationName' Value='Operation' />
                        <om:Property Name='OperationMessageName' Value='Request' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='SendManifestComplete' />
                        <om:Property Name='Signal' Value='True' />
                    </om:Element>
                    <om:Element Type='MessageDeclaration' OID='e68547b4-e318-4ec0-83ec-4f836f9a62c6' ParentLink='Scope_MessageDeclaration' LowerBound='222.1' HigherBound='223.1'>
                        <om:Property Name='Type' Value='PeDALS.SC.Orchestrations.PublicServiceCommissionOrdersFileMessageType' />
                        <om:Property Name='ParamDirection' Value='In' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='ManifestFileMsg' />
                        <om:Property Name='Signal' Value='True' />
                    </om:Element>
                    <om:Element Type='MessageDeclaration' OID='f9d19871-1c7c-4979-89ed-2128c0825d7c' ParentLink='Scope_MessageDeclaration' LowerBound='223.1' HigherBound='224.1'>
                        <om:Property Name='Type' Value='PeDALS.Orchestrations.NZMetadataFileMessageType' />
                        <om:Property Name='ParamDirection' Value='In' />
                        <om:Property Name='ReportToAnalyst' Value='True' />
                        <om:Property Name='Name' Value='NZMetadataFileMsg' />
                        <om:Property Name='Signal' Value='True' />
                    </om:Element>
                </om:Element>
            </om:Element>
            <om:Element Type='PortDeclaration' OID='02ccede3-7c1a-43e2-9e2e-83735c06b3aa' ParentLink='ServiceDeclaration_PortDeclaration' LowerBound='51.1' HigherBound='53.1'>
                <om:Property Name='PortModifier' Value='Implements' />
                <om:Property Name='Orientation' Value='Left' />
                <om:Property Name='PortIndex' Value='6' />
                <om:Property Name='IsWebPort' Value='False' />
                <om:Property Name='OrderedDelivery' Value='False' />
                <om:Property Name='DeliveryNotification' Value='None' />
                <om:Property Name='Type' Value='PeDALS.SC.Orchestrations.PSCShippingManifestPortType' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='ManifestPort' />
                <om:Property Name='Signal' Value='True' />
                <om:Element Type='LogicalBindingAttribute' OID='7977c2e9-0fe8-44b8-bc79-a7e8b86963a4' ParentLink='PortDeclaration_CLRAttribute' LowerBound='51.1' HigherBound='52.1'>
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
            </om:Element>
            <om:Element Type='PortDeclaration' OID='3b78ec93-e501-435d-a9fd-9f261838724c' ParentLink='ServiceDeclaration_PortDeclaration' LowerBound='53.1' HigherBound='55.1'>
                <om:Property Name='PortModifier' Value='Uses' />
                <om:Property Name='Orientation' Value='Right' />
                <om:Property Name='PortIndex' Value='151' />
                <om:Property Name='IsWebPort' Value='False' />
                <om:Property Name='OrderedDelivery' Value='False' />
                <om:Property Name='DeliveryNotification' Value='None' />
                <om:Property Name='Type' Value='PeDALS.SC.Orchestrations.ManifestCompletePortType' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='ManifestCompletePort' />
                <om:Property Name='Signal' Value='True' />
                <om:Element Type='DirectBindingAttribute' OID='285cc96c-ee65-4054-922e-f04bb0a8ce12' ParentLink='PortDeclaration_CLRAttribute' LowerBound='53.1' HigherBound='54.1'>
                    <om:Property Name='DirectBindingType' Value='MessageBox' />
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
            </om:Element>
            <om:Element Type='PortDeclaration' OID='b34f4bd5-f90b-4439-b0ad-08d5e7ddcb5e' ParentLink='ServiceDeclaration_PortDeclaration' LowerBound='55.1' HigherBound='57.1'>
                <om:Property Name='PortModifier' Value='Uses' />
                <om:Property Name='Orientation' Value='Right' />
                <om:Property Name='PortIndex' Value='52' />
                <om:Property Name='IsWebPort' Value='False' />
                <om:Property Name='OrderedDelivery' Value='False' />
                <om:Property Name='DeliveryNotification' Value='None' />
                <om:Property Name='Type' Value='PeDALS.SC.Orchestrations.NotificationPortType' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='PublishNotificationPort' />
                <om:Property Name='Signal' Value='True' />
                <om:Element Type='DirectBindingAttribute' OID='9b175e21-ffe2-486e-af4e-facb760d7b81' ParentLink='PortDeclaration_CLRAttribute' LowerBound='55.1' HigherBound='56.1'>
                    <om:Property Name='DirectBindingType' Value='MessageBox' />
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
            </om:Element>
            <om:Element Type='PortDeclaration' OID='534d3d3b-d115-455e-aaa4-b08a4e763e58' ParentLink='ServiceDeclaration_PortDeclaration' LowerBound='57.1' HigherBound='59.1'>
                <om:Property Name='PortModifier' Value='Implements' />
                <om:Property Name='Orientation' Value='Right' />
                <om:Property Name='PortIndex' Value='9' />
                <om:Property Name='IsWebPort' Value='False' />
                <om:Property Name='OrderedDelivery' Value='False' />
                <om:Property Name='DeliveryNotification' Value='None' />
                <om:Property Name='Type' Value='PeDALS.Orchestrations.NZMetadataPortType' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='NZMetadataExtractorPort' />
                <om:Property Name='Signal' Value='False' />
                <om:Element Type='LogicalBindingAttribute' OID='c6fc82a0-ba48-457b-b273-ca150a98aa47' ParentLink='PortDeclaration_CLRAttribute' LowerBound='57.1' HigherBound='58.1'>
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
            </om:Element>
            <om:Element Type='PortDeclaration' OID='341fe491-0466-4c8a-9169-244814649b3b' ParentLink='ServiceDeclaration_PortDeclaration' LowerBound='59.1' HigherBound='61.1'>
                <om:Property Name='PortModifier' Value='Implements' />
                <om:Property Name='Orientation' Value='Left' />
                <om:Property Name='PortIndex' Value='1' />
                <om:Property Name='IsWebPort' Value='False' />
                <om:Property Name='OrderedDelivery' Value='False' />
                <om:Property Name='DeliveryNotification' Value='None' />
                <om:Property Name='Type' Value='PeDALS.SC.Orchestrations.Get_PSC_Orders' />
                <om:Property Name='ParamDirection' Value='In' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='OrdersPort' />
                <om:Property Name='Signal' Value='True' />
                <om:Element Type='LogicalBindingAttribute' OID='e2f9a89b-86af-46af-9ea5-bd18760fd8be' ParentLink='PortDeclaration_CLRAttribute' LowerBound='59.1' HigherBound='60.1'>
                    <om:Property Name='Signal' Value='False' />
                </om:Element>
            </om:Element>
        </om:Element>
        <om:Element Type='MultipartMessageType' OID='83a03ae5-60a5-4610-951a-2863f73bd0a7' ParentLink='Module_MessageType' LowerBound='4.1' HigherBound='8.1'>
            <om:Property Name='TypeModifier' Value='Internal' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='PublicServiceCommissionOrdersManifestMessageType' />
            <om:Property Name='Signal' Value='True' />
            <om:Element Type='PartDeclaration' OID='b79854da-6d76-4750-8998-677a0224ed2d' ParentLink='MultipartMessageType_PartDeclaration' LowerBound='6.1' HigherBound='7.1'>
                <om:Property Name='ClassName' Value='PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Manifest' />
                <om:Property Name='IsBodyPart' Value='True' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='Body' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
        </om:Element>
        <om:Element Type='MultipartMessageType' OID='5b4e0323-c046-4338-81bc-6f71f7372df2' ParentLink='Module_MessageType' LowerBound='8.1' HigherBound='12.1'>
            <om:Property Name='TypeModifier' Value='Internal' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='PublicServiceCommissionOrdersFileMessageType' />
            <om:Property Name='Signal' Value='True' />
            <om:Element Type='PartDeclaration' OID='9d5f2fad-0549-4c90-9a68-304d937f2fa4' ParentLink='MultipartMessageType_PartDeclaration' LowerBound='10.1' HigherBound='11.1'>
                <om:Property Name='ClassName' Value='PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_File' />
                <om:Property Name='IsBodyPart' Value='True' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='Body' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
        </om:Element>
        <om:Element Type='MultipartMessageType' OID='2932d2fc-8f91-4772-b719-3fb8d823d87f' ParentLink='Module_MessageType' LowerBound='12.1' HigherBound='16.1'>
            <om:Property Name='TypeModifier' Value='Internal' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='PublicServiceCommissionOrdersMetadataMessageType' />
            <om:Property Name='Signal' Value='True' />
            <om:Element Type='PartDeclaration' OID='d56a276f-6ad8-417c-893a-f11ec816b134' ParentLink='MultipartMessageType_PartDeclaration' LowerBound='14.1' HigherBound='15.1'>
                <om:Property Name='ClassName' Value='PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Metadata' />
                <om:Property Name='IsBodyPart' Value='True' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='Body' />
                <om:Property Name='Signal' Value='True' />
            </om:Element>
        </om:Element>
        <om:Element Type='CorrelationType' OID='97221e27-37db-4bf9-bf2b-02aadda71036' ParentLink='Module_CorrelationType' LowerBound='44.1' HigherBound='48.1'>
            <om:Property Name='TypeModifier' Value='Internal' />
            <om:Property Name='ReportToAnalyst' Value='True' />
            <om:Property Name='Name' Value='RecvPortIdCorrelationType' />
            <om:Property Name='Signal' Value='True' />
            <om:Element Type='PropertyRef' OID='4c88004c-98ac-4d66-a352-587a86c89b13' ParentLink='CorrelationType_PropertyRef' LowerBound='46.9' HigherBound='46.26'>
                <om:Property Name='Ref' Value='BTS.ReceivePortID' />
                <om:Property Name='ReportToAnalyst' Value='True' />
                <om:Property Name='Name' Value='PropertyRef_1' />
                <om:Property Name='Signal' Value='False' />
            </om:Element>
        </om:Element>
    </om:Element>
</om:MetaModel>
";

        [System.SerializableAttribute]
        public class __PSCOrders_root_0 : Microsoft.XLANGs.Core.ServiceContext
        {
            public __PSCOrders_root_0(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "PSCOrders")
            {
            }

            public override int Index { get { return 0; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[0]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[0]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Finally();
                return false;
            }

            public override void Finally()
            {
                PSCOrders __svc__ = (PSCOrders)_service;
                __PSCOrders_root_0 __ctx0__ = (__PSCOrders_root_0)(__svc__._stateMgrs[0]);

                if (__svc__.PublishNotificationPort != null)
                {
                    __svc__.PublishNotificationPort.Close(this, null);
                    __svc__.PublishNotificationPort = null;
                }
                if (__svc__.ManifestCompletePort != null)
                {
                    __svc__.ManifestCompletePort.Close(this, null);
                    __svc__.ManifestCompletePort = null;
                }
                if (__svc__.ManifestPort != null)
                {
                    __svc__.ManifestPort.Close(this, null);
                    __svc__.ManifestPort = null;
                }
                if (__svc__.OrdersPort != null)
                {
                    __svc__.OrdersPort.Close(this, null);
                    __svc__.OrdersPort = null;
                }
                if (__svc__.NZMetadataExtractorPort != null)
                {
                    __svc__.NZMetadataExtractorPort.Close(this, null);
                    __svc__.NZMetadataExtractorPort = null;
                }
                base.Finally();
            }

            internal Microsoft.XLANGs.Core.SubscriptionWrapper __subWrapper0;
            internal Microsoft.XLANGs.Core.SubscriptionWrapper __subWrapper1;
            internal Microsoft.XLANGs.Core.SubscriptionWrapper __subWrapper2;
        }


        [System.SerializableAttribute]
        public class __PSCOrders_1 : Microsoft.XLANGs.Core.LongRunningTransaction
        {
            public __PSCOrders_1(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "PSCOrders")
            {
            }

            public override int Index { get { return 1; } }

            public override bool CombineParentCommit { get { return true; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[1]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[1]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Finally();
                return false;
            }

            public override void Finally()
            {
                PSCOrders __svc__ = (PSCOrders)_service;
                __PSCOrders_1 __ctx1__ = (__PSCOrders_1)(__svc__._stateMgrs[1]);
                __Transaction_5_6 __ctx6__ = (__Transaction_5_6)(__svc__._stateMgrs[6]);
                __Transaction_2_8 __ctx8__ = (__Transaction_2_8)(__svc__._stateMgrs[8]);

                if (__ctx1__ != null && __ctx1__.__ManifestCompleteMsg != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__ManifestCompleteMsg);
                    __ctx1__.__ManifestCompleteMsg = null;
                }
                if (__ctx1__ != null && __ctx1__.__RecvPortId != null)
                    __ctx1__.__RecvPortId = null;
                if (__ctx6__ != null && __ctx6__.__BaseAipMsg != null)
                {
                    __ctx6__.UnrefMessage(__ctx6__.__BaseAipMsg);
                    __ctx6__.__BaseAipMsg = null;
                }
                if (__ctx6__ != null)
                    __ctx6__.__superPackageId = null;
                if (__ctx6__ != null)
                    __ctx6__.__seriesAcquisitionDir = null;
                if (__ctx8__ != null && __ctx8__.__ManifestCompleteMsg != null)
                {
                    __ctx8__.UnrefMessage(__ctx8__.__ManifestCompleteMsg);
                    __ctx8__.__ManifestCompleteMsg = null;
                }
                base.Finally();
            }

            [Microsoft.XLANGs.Core.UserVariableAttribute("OrderMsg")]
            public __messagetype_PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Order __OrderMsg;
            [Microsoft.XLANGs.Core.UserVariableAttribute("PscManifestMsg")]
            internal PublicServiceCommissionOrdersManifestMessageType __PscManifestMsg;
            [Microsoft.XLANGs.Core.UserVariableAttribute("NZMetadataMsg")]
            internal PeDALS.Orchestrations.NZMetadataMessageType __NZMetadataMsg;
            [Microsoft.XLANGs.Core.UserVariableAttribute("BaseAipMsg")]
            internal PeDALS.Orchestrations.AchivalIngestPackageMessageType __BaseAipMsg;
            [Microsoft.XLANGs.Core.UserVariableAttribute("ManifestCompleteMsg")]
            public __messagetype_PeDALS_Schema_AIP_ManifestComplete __ManifestCompleteMsg;
            [Microsoft.XLANGs.Core.UserVariableAttribute("PscOrdersMsg")]
            internal PublicServiceCommissionOrdersMetadataMessageType __PscOrdersMsg;
            [Microsoft.XLANGs.Core.UserVariableAttribute("RecvPortId")]
            internal Microsoft.XLANGs.Core.Correlation __RecvPortId;
            [Microsoft.XLANGs.Core.UserVariableAttribute("doc")]
            internal Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy __doc;
            [Microsoft.XLANGs.Core.UserVariableAttribute("manifestCount")]
            internal System.Int32 __manifestCount;
            [Microsoft.XLANGs.Core.UserVariableAttribute("metadataCount")]
            internal System.Int32 __metadataCount;
            [Microsoft.XLANGs.Core.UserVariableAttribute("seriesAcquisitionDir")]
            internal System.String __seriesAcquisitionDir;
            [Microsoft.XLANGs.Core.UserVariableAttribute("seriesAcquisitionId")]
            internal System.Int32 __seriesAcquisitionId;
            [Microsoft.XLANGs.Core.UserVariableAttribute("seriesId")]
            internal System.Int32 __seriesId;
            [Microsoft.XLANGs.Core.UserVariableAttribute("superPackageId")]
            internal System.String __superPackageId;
            [Microsoft.XLANGs.Core.UserVariableAttribute("orderCount")]
            internal System.Int32 __orderCount;
        }


        [System.SerializableAttribute]
        public class ____scope33_2 : Microsoft.XLANGs.Core.ExceptionHandlingContext
        {
            public ____scope33_2(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "??__scope33")
            {
            }

            public override int Index { get { return 2; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[3]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[3]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Finally();
                return false;
            }

            public override void Finally()
            {
                PSCOrders __svc__ = (PSCOrders)_service;
                ____scope33_2 __ctx2__ = (____scope33_2)(__svc__._stateMgrs[2]);

                if (__ctx2__ != null)
                    __ctx2__.__manifestXml = null;
                base.Finally();
            }

            [Microsoft.XLANGs.Core.UserVariableAttribute("manifestXml")]
            internal Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy __manifestXml;
        }


        [System.SerializableAttribute]
        public class ____scope34_3 : Microsoft.XLANGs.Core.ExceptionHandlingContext
        {
            public ____scope34_3(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "??__scope34")
            {
            }

            public override int Index { get { return 3; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[5]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[5]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Finally();
                return false;
            }

            public override void Finally()
            {
                PSCOrders __svc__ = (PSCOrders)_service;
                ____scope34_3 __ctx3__ = (____scope34_3)(__svc__._stateMgrs[3]);

                if (__ctx3__ != null)
                    __ctx3__.__metadataXml = null;
                base.Finally();
            }

            [Microsoft.XLANGs.Core.UserVariableAttribute("metadataXml")]
            internal Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy __metadataXml;
        }


        [System.SerializableAttribute]
        public class ____scope35_4 : Microsoft.XLANGs.Core.ExceptionHandlingContext
        {
            public ____scope35_4(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "??__scope35")
            {
            }

            public override int Index { get { return 4; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[7]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[7]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Finally();
                return false;
            }

            public override void Finally()
            {
                PSCOrders __svc__ = (PSCOrders)_service;
                ____scope35_4 __ctx4__ = (____scope35_4)(__svc__._stateMgrs[4]);

                if (__ctx4__ != null)
                    __ctx4__.__ordersXml = null;
                base.Finally();
            }

            [Microsoft.XLANGs.Core.UserVariableAttribute("ordersXml")]
            internal Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy __ordersXml;
        }


        [System.SerializableAttribute]
        public class ____scope36_5 : Microsoft.XLANGs.Core.ExceptionHandlingContext
        {
            public ____scope36_5(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "??__scope36")
            {
            }

            public override int Index { get { return 5; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[8]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[8]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Finally();
                return false;
            }

            public override void Finally()
            {
                PSCOrders __svc__ = (PSCOrders)_service;
                ____scope36_5 __ctx5__ = (____scope36_5)(__svc__._stateMgrs[5]);

                if (__ctx5__ != null && __ctx5__.__NotificationMsg != null)
                {
                    __ctx5__.UnrefMessage(__ctx5__.__NotificationMsg);
                    __ctx5__.__NotificationMsg = null;
                }
                base.Finally();
            }

            [Microsoft.XLANGs.Core.UserVariableAttribute("NotificationMsg")]
            public __messagetype_System_Xml_XmlDocument __NotificationMsg;
            [Microsoft.XLANGs.Core.UserVariableAttribute("zero")]
            internal System.Int32 __zero;
        }


        [System.SerializableAttribute]
        public class __Transaction_5_6 : Microsoft.XLANGs.Core.LongRunningTransaction
        {
            public __Transaction_5_6(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "Transaction_5")
            {
            }

            public override int Index { get { return 6; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[9]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[9]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Finally();
                return false;
            }

            public override void Finally()
            {
                PSCOrders __svc__ = (PSCOrders)_service;
                __PSCOrders_1 __ctx1__ = (__PSCOrders_1)(__svc__._stateMgrs[1]);
                __Transaction_5_6 __ctx6__ = (__Transaction_5_6)(__svc__._stateMgrs[6]);

                if (__ctx1__.__BaseAipMsg != null)
                    __ctx1__.UnrefMessage(__ctx1__.__BaseAipMsg);
                __ctx1__.__BaseAipMsg = __ctx6__.__BaseAipMsg;
                if (__ctx6__.__BaseAipMsg != null)
                    __ctx1__.RefMessage(__ctx1__.__BaseAipMsg);
                __ctx1__.__superPackageId = __ctx6__.__superPackageId;
                __ctx1__.__seriesId = __ctx6__.__seriesId;
                __ctx1__.__seriesAcquisitionId = __ctx6__.__seriesAcquisitionId;
                __ctx1__.__seriesAcquisitionDir = __ctx6__.__seriesAcquisitionDir;
                base.Finally();
            }

            [Microsoft.XLANGs.Core.UserVariableAttribute("BaseAipMsg")]
            internal PeDALS.Orchestrations.AchivalIngestPackageMessageType __BaseAipMsg;
            [Microsoft.XLANGs.Core.UserVariableAttribute("seriesAcquisitionDir")]
            internal System.String __seriesAcquisitionDir;
            [Microsoft.XLANGs.Core.UserVariableAttribute("seriesAcquisitionId")]
            internal System.Int32 __seriesAcquisitionId;
            [Microsoft.XLANGs.Core.UserVariableAttribute("seriesId")]
            internal System.Int32 __seriesId;
            [Microsoft.XLANGs.Core.UserVariableAttribute("superPackageId")]
            internal System.String __superPackageId;
        }


        [System.SerializableAttribute]
        public class ____scope39_7 : Microsoft.XLANGs.Core.ExceptionHandlingContext
        {
            public ____scope39_7(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "??__scope39")
            {
            }

            public override int Index { get { return 7; } }

            public override bool CombineParentCommit { get { return true; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[10]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[10]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Microsoft.XLANGs.Core.Segment __seg__;
                Microsoft.XLANGs.Core.FaultReceiveException __fault__;

                __exv__ = _exception;
                if (!(__exv__ is Microsoft.XLANGs.Core.UnknownException))
                {
                    __fault__ = __exv__ as Microsoft.XLANGs.Core.FaultReceiveException;
                    if ((__fault__ == null) && (__exv__ is System.NullReferenceException))
                    {
                        __seg__ = _service._segments[11];
                        __seg__.Reset(1);
                        __seg__.PredecessorDone(_service);
                        return true;
                    }
                    if ((__fault__ == null) && (__exv__ is System.InvalidCastException))
                    {
                        __seg__ = _service._segments[12];
                        __seg__.Reset(1);
                        __seg__.PredecessorDone(_service);
                        return true;
                    }
                }

                Finally();
                return false;
            }

            public override void Finally()
            {
                PSCOrders __svc__ = (PSCOrders)_service;
                ____scope39_7 __ctx7__ = (____scope39_7)(__svc__._stateMgrs[7]);

                if (__ctx7__ != null)
                    __ctx7__.__ex_0 = null;
                if (__ctx7__ != null)
                    __ctx7__.__ex_1 = null;
                base.Finally();
            }

            internal object __exv__;
            internal System.NullReferenceException __ex_0
            {
                get { return (System.NullReferenceException)__exv__; }
                set { __exv__ = value; }
            }
            internal System.InvalidCastException __ex_1
            {
                get { return (System.InvalidCastException)__exv__; }
                set { __exv__ = value; }
            }
        }


        [System.SerializableAttribute]
        public class __Transaction_2_8 : Microsoft.XLANGs.Core.LongRunningTransaction
        {
            public __Transaction_2_8(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "Transaction_2")
            {
            }

            public override int Index { get { return 8; } }

            public override bool CombineParentCommit { get { return true; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[13]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[13]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Finally();
                return false;
            }

            public override void Finally()
            {
                PSCOrders __svc__ = (PSCOrders)_service;
                __PSCOrders_1 __ctx1__ = (__PSCOrders_1)(__svc__._stateMgrs[1]);
                __Transaction_3_10 __ctx10__ = (__Transaction_3_10)(__svc__._stateMgrs[10]);
                __Transaction_2_8 __ctx8__ = (__Transaction_2_8)(__svc__._stateMgrs[8]);

                if (__ctx1__.__ManifestCompleteMsg != null)
                    __ctx1__.UnrefMessage(__ctx1__.__ManifestCompleteMsg);
                __ctx1__.__ManifestCompleteMsg = __ctx8__.__ManifestCompleteMsg;
                if (__ctx8__.__ManifestCompleteMsg != null)
                    __ctx1__.RefMessage(__ctx1__.__ManifestCompleteMsg);
                if (__ctx1__ != null && __ctx1__.__BaseAipMsg != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__BaseAipMsg);
                    __ctx1__.__BaseAipMsg = null;
                }
                if (__ctx1__ != null)
                    __ctx1__.__superPackageId = null;
                if (__ctx1__ != null)
                    __ctx1__.__seriesAcquisitionDir = null;
                if (__ctx1__ != null && __ctx1__.__NZMetadataMsg != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__NZMetadataMsg);
                    __ctx1__.__NZMetadataMsg = null;
                }
                if (__ctx1__ != null && __ctx1__.__PscManifestMsg != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__PscManifestMsg);
                    __ctx1__.__PscManifestMsg = null;
                }
                if (__ctx1__ != null && __ctx1__.__OrderMsg != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__OrderMsg);
                    __ctx1__.__OrderMsg = null;
                }
                if (__ctx8__ != null && __ctx8__.__NZMetadataFileMsg != null)
                {
                    __ctx8__.UnrefMessage(__ctx8__.__NZMetadataFileMsg);
                    __ctx8__.__NZMetadataFileMsg = null;
                }
                if (__ctx1__ != null && __ctx1__.__PscOrdersMsg != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__PscOrdersMsg);
                    __ctx1__.__PscOrdersMsg = null;
                }
                if (__ctx10__ != null && __ctx10__.__NZMetadataFileMsg != null)
                {
                    __ctx10__.UnrefMessage(__ctx10__.__NZMetadataFileMsg);
                    __ctx10__.__NZMetadataFileMsg = null;
                }
                if (__ctx10__ != null && __ctx10__.__OrderMsg != null)
                {
                    __ctx10__.UnrefMessage(__ctx10__.__OrderMsg);
                    __ctx10__.__OrderMsg = null;
                }
                if (__ctx1__ != null)
                    __ctx1__.__doc = null;
                base.Finally();
            }

            [Microsoft.XLANGs.Core.UserVariableAttribute("ManifestCompleteMsg")]
            public __messagetype_PeDALS_Schema_AIP_ManifestComplete __ManifestCompleteMsg;
            [Microsoft.XLANGs.Core.UserVariableAttribute("ManifestFileMsg")]
            internal PublicServiceCommissionOrdersFileMessageType __ManifestFileMsg;
            [Microsoft.XLANGs.Core.UserVariableAttribute("NZMetadataFileMsg")]
            internal PeDALS.Orchestrations.NZMetadataFileMessageType __NZMetadataFileMsg;
            [Microsoft.XLANGs.Core.UserVariableAttribute("recCount")]
            internal System.Int32 __recCount;
        }


        [System.SerializableAttribute]
        public class ____scope40_9 : Microsoft.XLANGs.Core.ExceptionHandlingContext
        {
            public ____scope40_9(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "??__scope40")
            {
            }

            public override int Index { get { return 9; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[14]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[14]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Finally();
                return false;
            }

            public override void Finally()
            {
                PSCOrders __svc__ = (PSCOrders)_service;
                ____scope40_9 __ctx9__ = (____scope40_9)(__svc__._stateMgrs[9]);

                if (__ctx9__ != null)
                    __ctx9__.__xmlManifest = null;
                if (__ctx9__ != null)
                    __ctx9__.__xmlTemp = null;
                base.Finally();
            }

            [Microsoft.XLANGs.Core.UserVariableAttribute("xmlManifest")]
            internal Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy __xmlManifest;
            [Microsoft.XLANGs.Core.UserVariableAttribute("xmlTemp")]
            internal Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy __xmlTemp;
        }


        [System.SerializableAttribute]
        public class __Transaction_3_10 : Microsoft.XLANGs.Core.LongRunningTransaction
        {
            public __Transaction_3_10(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "Transaction_3")
            {
            }

            public override int Index { get { return 10; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[15]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[15]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Finally();
                return false;
            }

            public override void Finally()
            {
                PSCOrders __svc__ = (PSCOrders)_service;
                __PSCOrders_1 __ctx1__ = (__PSCOrders_1)(__svc__._stateMgrs[1]);
                __Transaction_3_10 __ctx10__ = (__Transaction_3_10)(__svc__._stateMgrs[10]);
                __Transaction_2_8 __ctx8__ = (__Transaction_2_8)(__svc__._stateMgrs[8]);

                if (__ctx8__.__NZMetadataFileMsg != null)
                    __ctx8__.UnrefMessage(__ctx8__.__NZMetadataFileMsg);
                __ctx8__.__NZMetadataFileMsg = __ctx10__.__NZMetadataFileMsg;
                if (__ctx10__.__NZMetadataFileMsg != null)
                    __ctx8__.RefMessage(__ctx8__.__NZMetadataFileMsg);
                if (__ctx1__.__OrderMsg != null)
                    __ctx1__.UnrefMessage(__ctx1__.__OrderMsg);
                __ctx1__.__OrderMsg = __ctx10__.__OrderMsg;
                if (__ctx10__.__OrderMsg != null)
                    __ctx1__.RefMessage(__ctx1__.__OrderMsg);
                if (__ctx8__ != null && __ctx8__.__ManifestFileMsg != null)
                {
                    __ctx8__.UnrefMessage(__ctx8__.__ManifestFileMsg);
                    __ctx8__.__ManifestFileMsg = null;
                }
                if (__ctx10__ != null)
                    __ctx10__.__fileName = null;
                if (__ctx10__ != null)
                    __ctx10__.__projType = null;
                if (__ctx10__ != null)
                    __ctx10__.__xmlOrderMsg = null;
                if (__ctx10__ != null)
                    __ctx10__.__tempXML = null;
                base.Finally();
            }

            [Microsoft.XLANGs.Core.UserVariableAttribute("OrderMsg")]
            public __messagetype_PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Order __OrderMsg;
            [Microsoft.XLANGs.Core.UserVariableAttribute("NZMetadataFileMsg")]
            internal PeDALS.Orchestrations.NZMetadataFileMessageType __NZMetadataFileMsg;
            [Microsoft.XLANGs.Core.UserVariableAttribute("fileName")]
            internal System.String __fileName;
            [Microsoft.XLANGs.Core.UserVariableAttribute("projType")]
            internal System.String __projType;
            [Microsoft.XLANGs.Core.UserVariableAttribute("xmlOrderMsg")]
            internal Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy __xmlOrderMsg;
            [Microsoft.XLANGs.Core.UserVariableAttribute("tempXML")]
            internal Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy __tempXML;
        }


        [System.SerializableAttribute]
        public class __Transaction_4_11 : Microsoft.XLANGs.Core.LongRunningTransaction
        {
            public __Transaction_4_11(Microsoft.XLANGs.Core.Service svc)
                : base(svc, "Transaction_4")
            {
            }

            public override int Index { get { return 11; } }

            public override bool CombineParentCommit { get { return true; } }

            public override Microsoft.XLANGs.Core.Segment InitialSegment
            {
                get { return _service._segments[16]; }
            }
            public override Microsoft.XLANGs.Core.Segment FinalSegment
            {
                get { return _service._segments[16]; }
            }

            public override int CompensationSegment { get { return -1; } }
            public override bool OnError()
            {
                Finally();
                return false;
            }

            public override void Finally()
            {
                PSCOrders __svc__ = (PSCOrders)_service;
                __Transaction_4_11 __ctx11__ = (__Transaction_4_11)(__svc__._stateMgrs[11]);

                if (__ctx11__ != null && __ctx11__.__FinalAIPMsg != null)
                {
                    __ctx11__.UnrefMessage(__ctx11__.__FinalAIPMsg);
                    __ctx11__.__FinalAIPMsg = null;
                }
                if (__ctx11__ != null)
                    __ctx11__.__orgFileAsBase64 = null;
                if (__ctx11__ != null)
                    __ctx11__.__temp = null;
                if (__ctx11__ != null)
                    __ctx11__.__title = null;
                if (__ctx11__ != null)
                    __ctx11__.__xmlTemp = null;
                base.Finally();
            }

            [Microsoft.XLANGs.Core.UserVariableAttribute("FinalAIPMsg")]
            internal PeDALS.Orchestrations.AchivalIngestPackageMessageType __FinalAIPMsg;
            [Microsoft.XLANGs.Core.UserVariableAttribute("orgFileAsBase64")]
            internal System.String __orgFileAsBase64;
            [Microsoft.XLANGs.Core.UserVariableAttribute("temp")]
            internal System.String __temp;
            [Microsoft.XLANGs.Core.UserVariableAttribute("title")]
            internal System.String __title;
            [Microsoft.XLANGs.Core.UserVariableAttribute("xmlTemp")]
            internal Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy __xmlTemp;
        }

        private static Microsoft.XLANGs.Core.CorrelationType[] _correlationTypes = new Microsoft.XLANGs.Core.CorrelationType[] { new RecvPortIdCorrelationType() };
        public override Microsoft.XLANGs.Core.CorrelationType[] CorrelationTypes { get { return _correlationTypes; } }

        private static System.Guid[] _convoySetIds;

        public override System.Guid[] ConvoySetGuids
        {
            get { return _convoySetIds; }
            set { _convoySetIds = value; }
        }

        public static object[] StaticConvoySetInformation
        {
            get {
                return new object[] {
                    new Microsoft.XLANGs.Core.CorrelationType[] { _correlationTypes[0] }
                };
            }
        }

        [Microsoft.XLANGs.BaseTypes.LogicalBindingAttribute()]
        [Microsoft.XLANGs.BaseTypes.PortAttribute(
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.eImplements
        )]
        [Microsoft.XLANGs.Core.UserVariableAttribute("ManifestPort")]
        internal PSCShippingManifestPortType ManifestPort;
        [Microsoft.XLANGs.BaseTypes.LogicalBindingAttribute()]
        [Microsoft.XLANGs.BaseTypes.PortAttribute(
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.eImplements
        )]
        [Microsoft.XLANGs.Core.UserVariableAttribute("NZMetadataExtractorPort")]
        internal PeDALS.Orchestrations.NZMetadataPortType NZMetadataExtractorPort;
        [Microsoft.XLANGs.BaseTypes.LogicalBindingAttribute()]
        [Microsoft.XLANGs.BaseTypes.PortAttribute(
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.eImplements
        )]
        [Microsoft.XLANGs.Core.UserVariableAttribute("OrdersPort")]
        internal Get_PSC_Orders OrdersPort;
        [Microsoft.XLANGs.BaseTypes.DirectBindingAttribute()]
        [Microsoft.XLANGs.BaseTypes.PortAttribute(
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.eUses
        )]
        [Microsoft.XLANGs.Core.UserVariableAttribute("PublishNotificationPort")]
        internal NotificationPortType PublishNotificationPort;
        [Microsoft.XLANGs.BaseTypes.DirectBindingAttribute()]
        [Microsoft.XLANGs.BaseTypes.PortAttribute(
            Microsoft.XLANGs.BaseTypes.EXLangSParameter.eUses
        )]
        [Microsoft.XLANGs.Core.UserVariableAttribute("ManifestCompletePort")]
        internal ManifestCompletePortType ManifestCompletePort;

        public static Microsoft.XLANGs.Core.PortInfo[] _portInfo = new Microsoft.XLANGs.Core.PortInfo[] {
            new Microsoft.XLANGs.Core.PortInfo(new Microsoft.XLANGs.Core.OperationInfo[] {PSCShippingManifestPortType.GetPSCManifest},
                                               typeof(PSCOrders).GetField("ManifestPort", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance),
                                               Microsoft.XLANGs.BaseTypes.Polarity.implements,
                                               false,
                                               Microsoft.XLANGs.Core.HashHelper.HashPort(typeof(PSCOrders), "ManifestPort"),
                                               null),
            new Microsoft.XLANGs.Core.PortInfo(new Microsoft.XLANGs.Core.OperationInfo[] {PeDALS.Orchestrations.NZMetadataPortType.NZ_Metadata_Extractor},
                                               typeof(PSCOrders).GetField("NZMetadataExtractorPort", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance),
                                               Microsoft.XLANGs.BaseTypes.Polarity.implements,
                                               false,
                                               Microsoft.XLANGs.Core.HashHelper.HashPort(typeof(PSCOrders), "NZMetadataExtractorPort"),
                                               null),
            new Microsoft.XLANGs.Core.PortInfo(new Microsoft.XLANGs.Core.OperationInfo[] {Get_PSC_Orders.GetPSCOrders},
                                               typeof(PSCOrders).GetField("OrdersPort", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance),
                                               Microsoft.XLANGs.BaseTypes.Polarity.implements,
                                               false,
                                               Microsoft.XLANGs.Core.HashHelper.HashPort(typeof(PSCOrders), "OrdersPort"),
                                               null),
            new Microsoft.XLANGs.Core.PortInfo(new Microsoft.XLANGs.Core.OperationInfo[] {NotificationPortType.PublishNotification},
                                               typeof(PSCOrders).GetField("PublishNotificationPort", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance),
                                               Microsoft.XLANGs.BaseTypes.Polarity.uses,
                                               false,
                                               Microsoft.XLANGs.Core.HashHelper.HashPort(typeof(PSCOrders), "PublishNotificationPort"),
                                               null),
            new Microsoft.XLANGs.Core.PortInfo(new Microsoft.XLANGs.Core.OperationInfo[] {ManifestCompletePortType.Operation},
                                               typeof(PSCOrders).GetField("ManifestCompletePort", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance),
                                               Microsoft.XLANGs.BaseTypes.Polarity.uses,
                                               false,
                                               Microsoft.XLANGs.Core.HashHelper.HashPort(typeof(PSCOrders), "ManifestCompletePort"),
                                               null)
        };

        public override Microsoft.XLANGs.Core.PortInfo[] PortInformation
        {
            get { return _portInfo; }
        }

        static public System.Collections.Hashtable PortsInformation
        {
            get
            {
                System.Collections.Hashtable h = new System.Collections.Hashtable();
                h[_portInfo[0].Name] = _portInfo[0];
                h[_portInfo[1].Name] = _portInfo[1];
                h[_portInfo[2].Name] = _portInfo[2];
                h[_portInfo[3].Name] = _portInfo[3];
                h[_portInfo[4].Name] = _portInfo[4];
                return h;
            }
        }

        public static System.Type[] InvokedServicesTypes
        {
            get
            {
                return new System.Type[] {
                    // type of each service invoked by this service
                };
            }
        }

        public static System.Type[] CalledServicesTypes
        {
            get
            {
                return new System.Type[] {
                    typeof(PeDALS.Orchestrations.GetInitialValues),
                    typeof(PeDALS.Orchestrations.InsertAIP),
                    typeof(PeDALS.Orchestrations.SplitNZMetadataMessage)                    
                };
            }
        }

        public static System.Type[] ExecedServicesTypes
        {
            get
            {
                return new System.Type[] {
                };
            }
        }

        public static object[] StaticSubscriptionsInformation {
            get {
                return new object[3]{
                     new object[5] { _portInfo[0], 0, null , 0, true }
                    , new object[5] { _portInfo[1], 0, null , 0, true }
                    , new object[5] { _portInfo[2], 0, null , 0, true }
                };
            }
        }

        public static Microsoft.XLANGs.RuntimeTypes.Location[] __eventLocations = new Microsoft.XLANGs.RuntimeTypes.Location[] {
            new Microsoft.XLANGs.RuntimeTypes.Location(0, "00000000-0000-0000-0000-000000000000", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(1, "8eded03a-6b00-48a1-a114-e9e6a6db1c33", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(2, "8eded03a-6b00-48a1-a114-e9e6a6db1c33", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(3, "454f167b-bc89-49a2-a240-c926014600d1", 2, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(4, "454f167b-bc89-49a2-a240-c926014600d1", 2, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(5, "8c590e61-a410-4610-905a-d34d38b0bff7", 2, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(6, "00000000-0000-0000-0000-000000000000", 3, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(7, "00000000-0000-0000-0000-000000000000", 3, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(8, "985043b4-d731-4d68-b142-c4e600e8a461", 3, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(9, "985043b4-d731-4d68-b142-c4e600e8a461", 3, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(10, "8c590e61-a410-4610-905a-d34d38b0bff7", 2, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(11, "b3c88acc-7060-461b-a740-f2ce582e91ef", 4, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(12, "b3c88acc-7060-461b-a740-f2ce582e91ef", 4, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(13, "5dbe8c5b-b8dd-4b2c-935a-975ba7aff3ff", 4, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(14, "00000000-0000-0000-0000-000000000000", 5, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(15, "00000000-0000-0000-0000-000000000000", 5, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(16, "699b7dcf-b1c4-4f0a-bc38-e066bf3b336d", 5, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(17, "699b7dcf-b1c4-4f0a-bc38-e066bf3b336d", 5, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(18, "5dbe8c5b-b8dd-4b2c-935a-975ba7aff3ff", 4, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(19, "6edce67b-d70b-4566-9413-bbf069d18629", 6, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(20, "6edce67b-d70b-4566-9413-bbf069d18629", 6, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(21, "bd79e111-95a3-462b-8828-9afa05e54796", 6, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(22, "00000000-0000-0000-0000-000000000000", 7, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(23, "00000000-0000-0000-0000-000000000000", 7, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(24, "cdb436ae-3e11-42fb-b11f-fea274b4f5c5", 7, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(25, "cdb436ae-3e11-42fb-b11f-fea274b4f5c5", 7, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(26, "bd79e111-95a3-462b-8828-9afa05e54796", 6, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(27, "cf0a62d0-1efe-42e5-a3ae-b01107f682b9", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(28, "2f6f9914-0c7b-4ca2-a708-7459a3bae31b", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(29, "00000000-0000-0000-0000-000000000000", 8, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(30, "00000000-0000-0000-0000-000000000000", 8, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(31, "c529251e-79a1-41b3-8f02-9cf038a59535", 8, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(32, "c529251e-79a1-41b3-8f02-9cf038a59535", 8, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(33, "e08fd8a8-8205-466d-9022-4da8c159fd1c", 8, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(34, "e08fd8a8-8205-466d-9022-4da8c159fd1c", 8, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(35, "b08521d4-4d29-42d4-b57c-d3f887e648fc", 8, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(36, "b08521d4-4d29-42d4-b57c-d3f887e648fc", 8, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(37, "2f6f9914-0c7b-4ca2-a708-7459a3bae31b", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(38, "a9256c66-02a1-48ea-bbfd-eb71d79a5b41", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(39, "cf0a62d0-1efe-42e5-a3ae-b01107f682b9", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(40, "b5961eed-755f-44b6-bdd4-bf8abf85065a", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(41, "00000000-0000-0000-0000-000000000000", 9, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(42, "140b02aa-fe7d-4e9c-bbdb-df85033b0544", 9, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(43, "140b02aa-fe7d-4e9c-bbdb-df85033b0544", 9, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(44, "2e8431ec-9ed6-4379-947a-3ee638b287cb", 9, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(45, "00000000-0000-0000-0000-000000000000", 10, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(46, "66e4c22e-1b51-41b3-9398-69bb3f450ee6", 10, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(47, "66e4c22e-1b51-41b3-9398-69bb3f450ee6", 10, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(48, "00000000-0000-0000-0000-000000000000", 10, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(49, "58241bd6-c432-44ab-ae1f-e2824d7b333d", 11, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(50, "01fec934-7d35-47a8-9edf-50d727b32f98", 11, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(51, "58241bd6-c432-44ab-ae1f-e2824d7b333d", 11, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(52, "e7d65d3d-222a-45b5-b043-64272d32fc66", 12, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(53, "e4079179-31a6-4638-8cbc-f14258da3655", 12, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(54, "e7d65d3d-222a-45b5-b043-64272d32fc66", 12, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(55, "2e8431ec-9ed6-4379-947a-3ee638b287cb", 9, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(56, "b5961eed-755f-44b6-bdd4-bf8abf85065a", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(57, "4d178d9e-e695-4308-87bd-30236d4d2445", 1, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(58, "00000000-0000-0000-0000-000000000000", 13, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(59, "0944c685-d5ac-4482-a077-01eb8386f59a", 13, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(60, "0944c685-d5ac-4482-a077-01eb8386f59a", 13, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(61, "fd7d317b-d1d3-41a1-96ed-38a127e7a365", 13, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(62, "bba9eb88-a980-4ff6-ae96-d71f9d4a1711", 13, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(63, "00000000-0000-0000-0000-000000000000", 14, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(64, "00000000-0000-0000-0000-000000000000", 14, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(65, "9eb3f1b6-1865-456d-9046-85ae90e19c39", 14, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(66, "9eb3f1b6-1865-456d-9046-85ae90e19c39", 14, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(67, "bba9eb88-a980-4ff6-ae96-d71f9d4a1711", 13, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(68, "21600035-28ec-4bd3-8802-155b8ae13d5a", 13, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(69, "00000000-0000-0000-0000-000000000000", 15, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(70, "00000000-0000-0000-0000-000000000000", 15, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(71, "faeea142-4f11-4155-aac7-2357c89e1d34", 15, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(72, "faeea142-4f11-4155-aac7-2357c89e1d34", 15, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(73, "330a93dc-2192-4f67-88b4-4d6841ccd143", 15, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(74, "fd452544-d07f-4c11-a64b-b8d72ac0fef1", 15, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(75, "fd452544-d07f-4c11-a64b-b8d72ac0fef1", 15, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(76, "c10ae42c-d7e5-41df-a4f3-8b1c98ce491d", 15, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(77, "c10ae42c-d7e5-41df-a4f3-8b1c98ce491d", 15, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(78, "32c4e3b7-152d-484e-a890-4a7e765040d1", 15, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(79, "00000000-0000-0000-0000-000000000000", 16, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(80, "00000000-0000-0000-0000-000000000000", 16, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(81, "35003316-0b10-4d25-b77f-88eae41bb8d9", 16, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(82, "35003316-0b10-4d25-b77f-88eae41bb8d9", 16, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(83, "e17ae477-e9c1-465f-b6bf-2b8bc526fe6f", 16, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(84, "e17ae477-e9c1-465f-b6bf-2b8bc526fe6f", 16, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(85, "32c4e3b7-152d-484e-a890-4a7e765040d1", 15, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(86, "330a93dc-2192-4f67-88b4-4d6841ccd143", 15, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(87, "21600035-28ec-4bd3-8802-155b8ae13d5a", 13, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(88, "6049336b-e3b8-4c24-8857-d60ce5ab9515", 13, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(89, "6049336b-e3b8-4c24-8857-d60ce5ab9515", 13, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(90, "fd7d317b-d1d3-41a1-96ed-38a127e7a365", 13, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(91, "69bac0fb-14e4-40b7-8607-6f95fe182b96", 13, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(92, "69bac0fb-14e4-40b7-8607-6f95fe182b96", 13, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(93, "5540f757-cb4c-4b1d-9c9f-a3f22384ddab", 13, true),
            new Microsoft.XLANGs.RuntimeTypes.Location(94, "5540f757-cb4c-4b1d-9c9f-a3f22384ddab", 13, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(95, "4d178d9e-e695-4308-87bd-30236d4d2445", 1, false),
            new Microsoft.XLANGs.RuntimeTypes.Location(96, "00000000-0000-0000-0000-000000000000", 1, false)
        };

        public override Microsoft.XLANGs.RuntimeTypes.Location[] EventLocations
        {
            get { return __eventLocations; }
        }

        public static Microsoft.XLANGs.RuntimeTypes.EventData[] __eventData = new Microsoft.XLANGs.RuntimeTypes.EventData[] {
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Body),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Parallel),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Receive),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Scope),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Expression),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Expression),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Scope),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Parallel),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.If),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Construct),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Send),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Terminate),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.If),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Call),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Call),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Catch),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.Throw),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Catch),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.WhileBody),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.Start | Microsoft.XLANGs.RuntimeTypes.Operation.While),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.While),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.WhileBody),
            new Microsoft.XLANGs.RuntimeTypes.EventData( Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Body)
        };

        public static int[] __progressLocation0 = new int[] { 0,0,0,96,96,};
        public static int[] __progressLocation1 = new int[] { 0,0,1,3,2,2,27,27,28,28,28,37,38,38,39,40,40,40,56,57,57,57,95,96,96,96,96,};
        public static int[] __progressLocation2 = new int[] { 3,3,4,5,5,5,10,2,};
        public static int[] __progressLocation3 = new int[] { 8,8,8,8,9,9,9,9,9,9,9,};
        public static int[] __progressLocation4 = new int[] { 11,11,12,13,13,13,18,2,};
        public static int[] __progressLocation5 = new int[] { 16,16,16,16,17,17,17,17,17,17,};
        public static int[] __progressLocation6 = new int[] { 19,19,20,21,21,21,26,2,};
        public static int[] __progressLocation7 = new int[] { 24,24,24,24,25,25,25,25,25,25,};
        public static int[] __progressLocation8 = new int[] { 31,31,31,31,32,32,32,33,33,34,35,35,35,36,36,36,36,};
        public static int[] __progressLocation9 = new int[] { 42,42,42,43,44,44,44,55,55,55,55,};
        public static int[] __progressLocation10 = new int[] { 46,46,46,47,47,47,47,47,47,47,};
        public static int[] __progressLocation11 = new int[] { 49,49,50,50,51,51,};
        public static int[] __progressLocation12 = new int[] { 52,52,53,53,54,54,};
        public static int[] __progressLocation13 = new int[] { 59,59,59,60,61,61,61,62,62,62,67,68,68,68,87,88,88,89,90,90,90,91,91,92,93,93,93,94,94,94,94,};
        public static int[] __progressLocation14 = new int[] { 65,65,65,65,65,66,66,66,66,};
        public static int[] __progressLocation15 = new int[] { 71,71,71,71,71,71,71,72,72,72,72,72,73,73,74,74,75,76,76,77,78,78,78,85,86,86,86,86,};
        public static int[] __progressLocation16 = new int[] { 81,81,81,81,81,81,81,82,83,83,84,84,84,84,};

        public static int[][] __progressLocations = new int[17] [] {__progressLocation0,__progressLocation1,__progressLocation2,__progressLocation3,__progressLocation4,__progressLocation5,__progressLocation6,__progressLocation7,__progressLocation8,__progressLocation9,__progressLocation10,__progressLocation11,__progressLocation12,__progressLocation13,__progressLocation14,__progressLocation15,__progressLocation16};
        public override int[][] ProgressLocations {get {return __progressLocations;} }

        public Microsoft.XLANGs.Core.StopConditions segment0(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[0];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[0];
            __PSCOrders_1 __ctx1__ = (__PSCOrders_1)_stateMgrs[1];
            __PSCOrders_root_0 __ctx0__ = (__PSCOrders_root_0)_stateMgrs[0];

            switch (__seg__.Progress)
            {
            case 0:
                ManifestPort = new PSCShippingManifestPortType(0, this);
                ManifestCompletePort = new ManifestCompletePortType(4, this);
                PublishNotificationPort = new NotificationPortType(3, this);
                NZMetadataExtractorPort = new PeDALS.Orchestrations.NZMetadataPortType(1, this);
                OrdersPort = new Get_PSC_Orders(2, this);
                __ctx__.PrologueCompleted = true;
                __ctx0__.__subWrapper0 = new Microsoft.XLANGs.Core.SubscriptionWrapper(ActivationSubGuids[0], ManifestPort, this);
                __ctx0__.__subWrapper1 = new Microsoft.XLANGs.Core.SubscriptionWrapper(ActivationSubGuids[1], NZMetadataExtractorPort, this);
                __ctx0__.__subWrapper2 = new Microsoft.XLANGs.Core.SubscriptionWrapper(ActivationSubGuids[2], OrdersPort, this);
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                if ((stopOn & Microsoft.XLANGs.Core.StopConditions.Initialized) != 0)
                    return Microsoft.XLANGs.Core.StopConditions.Initialized;
                goto case 1;
            case 1:
                __ctx1__ = new __PSCOrders_1(this);
                _stateMgrs[1] = __ctx1__;
                if ( !PostProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 2;
            case 2:
                __ctx0__.StartContext(__seg__, __ctx1__);
                if ( !PostProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 3:
                if (!__ctx0__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                __ctx1__.Finally();
                ServiceDone(__seg__, (Microsoft.XLANGs.Core.Context)_stateMgrs[0]);
                __ctx0__.OnCommit();
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment1(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            bool __condition__;
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[1];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[1];
            __PSCOrders_1 __ctx1__ = (__PSCOrders_1)_stateMgrs[1];
            __PSCOrders_root_0 __ctx0__ = (__PSCOrders_root_0)_stateMgrs[0];
            __Transaction_5_6 __ctx6__ = (__Transaction_5_6)_stateMgrs[6];
            ____scope36_5 __ctx5__ = (____scope36_5)_stateMgrs[5];
            __Transaction_2_8 __ctx8__ = (__Transaction_2_8)_stateMgrs[8];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx1__.__doc = new Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy();
                __ctx1__.__manifestCount = default(System.Int32);
                __ctx1__.__metadataCount = default(System.Int32);
                __ctx1__.__seriesAcquisitionDir = default(System.String);
                __ctx1__.__seriesAcquisitionId = default(System.Int32);
                __ctx1__.__seriesId = default(System.Int32);
                __ctx1__.__superPackageId = default(System.String);
                __ctx1__.__orderCount = default(System.Int32);
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[0],__eventData[0],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[1],__eventData[1],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                __ctx1__.__RecvPortId = new Microsoft.XLANGs.Core.Correlation(this, 0, 0);
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                __seg__.RunSegments(new Microsoft.XLANGs.Core.Segment[] {_segments[2], _segments[4], _segments[6]}, this);
                if ( !PostProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 5:
                if ( !PreProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                if (__ctx1__ != null && __ctx1__.__RecvPortId != null)
                    __ctx1__.__RecvPortId = null;
                if (OrdersPort != null)
                {
                    OrdersPort.Close(__ctx1__, __seg__);
                    OrdersPort = null;
                }
                if (NZMetadataExtractorPort != null)
                {
                    NZMetadataExtractorPort.Close(__ctx1__, __seg__);
                    NZMetadataExtractorPort = null;
                }
                if (ManifestPort != null)
                {
                    ManifestPort.Close(__ctx1__, __seg__);
                    ManifestPort = null;
                }
                Tracker.FireEvent(__eventLocations[2],__eventData[7],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 6;
            case 6:
                if ( !PreProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[27],__eventData[8],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 7;
            case 7:
                __condition__ = __ctx1__.__manifestCount != __ctx1__.__metadataCount & __ctx1__.__manifestCount != __ctx1__.__orderCount;
                if (!__condition__)
                {
                    if ( !PostProgressInc( __seg__, __ctx__, 14 ) )
                        return Microsoft.XLANGs.Core.StopConditions.Paused;
                    goto case 14;
                }
                if ( !PostProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 8;
            case 8:
                if ( !PreProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[28],__eventData[3],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 9;
            case 9:
                __ctx5__ = new ____scope36_5(this);
                _stateMgrs[5] = __ctx5__;
                if ( !PostProgressInc( __seg__, __ctx__, 10 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 10;
            case 10:
                __ctx1__.StartContext(__seg__, __ctx5__);
                if ( !PostProgressInc( __seg__, __ctx__, 11 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 11:
                if ( !PreProgressInc( __seg__, __ctx__, 12 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[37],__eventData[6],_stateMgrs[1].TrackDataStream );
                __ctx5__.Finally();
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 12;
            case 12:
                if ( !PreProgressInc( __seg__, __ctx__, 13 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[38],__eventData[11],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 13;
            case 13:
                RequestTerminate(__ctx1__,"Terminated due to count mismatch.");
                __seg__.SegmentDone();
                break;
            case 14:
                if ( !PreProgressInc( __seg__, __ctx__, 15 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                if (PublishNotificationPort != null)
                {
                    PublishNotificationPort.Close(__ctx1__, __seg__);
                    PublishNotificationPort = null;
                }
                Tracker.FireEvent(__eventLocations[39],__eventData[12],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 15;
            case 15:
                if ( !PreProgressInc( __seg__, __ctx__, 16 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[40],__eventData[3],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 16;
            case 16:
                __ctx6__ = new __Transaction_5_6(this);
                _stateMgrs[6] = __ctx6__;
                if ( !PostProgressInc( __seg__, __ctx__, 17 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 17;
            case 17:
                __ctx1__.StartContext(__seg__, __ctx6__);
                if ( !PostProgressInc( __seg__, __ctx__, 18 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 18:
                if ( !PreProgressInc( __seg__, __ctx__, 19 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[56],__eventData[6],_stateMgrs[1].TrackDataStream );
                __ctx6__.Finally();
                if (__ctx6__ != null)
                    __ctx6__.__superPackageId = null;
                if (__ctx6__ != null)
                    __ctx6__.__seriesAcquisitionDir = null;
                if (__ctx6__ != null && __ctx6__.__BaseAipMsg != null)
                {
                    __ctx6__.UnrefMessage(__ctx6__.__BaseAipMsg);
                    __ctx6__.__BaseAipMsg = null;
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 19;
            case 19:
                if ( !PreProgressInc( __seg__, __ctx__, 20 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[57],__eventData[3],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 20;
            case 20:
                __ctx8__ = new __Transaction_2_8(this);
                _stateMgrs[8] = __ctx8__;
                if ( !PostProgressInc( __seg__, __ctx__, 21 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 21;
            case 21:
                __ctx1__.StartContext(__seg__, __ctx8__);
                if ( !PostProgressInc( __seg__, __ctx__, 22 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 22:
                if ( !PreProgressInc( __seg__, __ctx__, 23 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[95],__eventData[6],_stateMgrs[1].TrackDataStream );
                __ctx8__.Finally();
                if (__ctx8__ != null && __ctx8__.__ManifestCompleteMsg != null)
                {
                    __ctx8__.UnrefMessage(__ctx8__.__ManifestCompleteMsg);
                    __ctx8__.__ManifestCompleteMsg = null;
                }
                if (__ctx1__ != null && __ctx1__.__ManifestCompleteMsg != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__ManifestCompleteMsg);
                    __ctx1__.__ManifestCompleteMsg = null;
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 23;
            case 23:
                if ( !PreProgressInc( __seg__, __ctx__, 24 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[96],__eventData[22],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 24;
            case 24:
                if (!__ctx1__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 25 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 25;
            case 25:
                if ( !PreProgressInc( __seg__, __ctx__, 26 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx1__.OnCommit();
                goto case 26;
            case 26:
                __seg__.SegmentDone();
                _segments[0].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment2(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Envelope __msgEnv__ = null;
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[2];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[1];
            __PSCOrders_1 __ctx1__ = (__PSCOrders_1)_stateMgrs[1];
            __PSCOrders_root_0 __ctx0__ = (__PSCOrders_root_0)_stateMgrs[0];
            ____scope33_2 __ctx2__ = (____scope33_2)_stateMgrs[2];

            switch (__seg__.Progress)
            {
            case 0:
                if ( !PreProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[3],__eventData[2],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 1;
            case 1:
                if (!ManifestPort.GetMessageId(__ctx0__.__subWrapper0.getSubscription(this), __seg__, __ctx1__, out __msgEnv__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if (__ctx1__.__PscManifestMsg != null)
                    __ctx1__.UnrefMessage(__ctx1__.__PscManifestMsg);
                __ctx1__.__PscManifestMsg = new PublicServiceCommissionOrdersManifestMessageType("PscManifestMsg", __ctx1__);
                __ctx1__.RefMessage(__ctx1__.__PscManifestMsg);
                ManifestPort.ReceiveMessage(0, __msgEnv__, __ctx1__.__PscManifestMsg, new Microsoft.XLANGs.Core.Correlation[] { __ctx1__.__RecvPortId }, (Microsoft.XLANGs.Core.Context)_stateMgrs[1], __seg__);
                if ( !PostProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Receive);
                    __edata.Messages.Add(__ctx1__.__PscManifestMsg);
                    __edata.PortName = @"ManifestPort";
                    Tracker.FireEvent(__eventLocations[4],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                if ( !PreProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[5],__eventData[3],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 4;
            case 4:
                __ctx2__ = new ____scope33_2(this);
                _stateMgrs[2] = __ctx2__;
                if ( !PostProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 5;
            case 5:
                __ctx1__.StartContext(__seg__, __ctx2__);
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 6:
                if ( !PreProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[10],__eventData[6],_stateMgrs[1].TrackDataStream );
                __ctx2__.Finally();
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 7;
            case 7:
                __seg__.SegmentDone();
                _segments[1].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment3(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[3];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[2];
            __PSCOrders_1 __ctx1__ = (__PSCOrders_1)_stateMgrs[1];
            ____scope33_2 __ctx2__ = (____scope33_2)_stateMgrs[2];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx2__.__manifestXml = new Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy();
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                __ctx2__.__manifestXml.UnderlyingXmlDocument = new System.Xml.XmlDocument();
                if ( !PostProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[8],__eventData[4],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                __ctx2__.__manifestXml.UnderlyingXmlDocument = __ctx1__.__PscManifestMsg.Body.TypedValue;
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[9],__eventData[5],_stateMgrs[2].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                __ctx1__.__manifestCount = PeDALS.Utilities.XmlHelper.GetNodeCount((System.Xml.XmlDocument)__ctx2__.__manifestXml.UnderlyingXmlDocument, "/*[local-name()='manifest' and namespace-uri()='']/*[local-name()='file' and namespace-uri()='']");
                if (__ctx2__ != null)
                    __ctx2__.__manifestXml = null;
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                __ctx1__.__manifestCount = __ctx1__.__manifestCount - 1;
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                System.Diagnostics.Debug.WriteLine("Manifest Count: " + System.Convert.ToString(__ctx1__.__manifestCount));
                if ( !PostProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 8;
            case 8:
                if (!__ctx2__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 9;
            case 9:
                if ( !PreProgressInc( __seg__, __ctx__, 10 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx2__.OnCommit();
                goto case 10;
            case 10:
                __seg__.SegmentDone();
                _segments[2].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment4(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Envelope __msgEnv__ = null;
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[4];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[1];
            __PSCOrders_1 __ctx1__ = (__PSCOrders_1)_stateMgrs[1];
            __PSCOrders_root_0 __ctx0__ = (__PSCOrders_root_0)_stateMgrs[0];
            ____scope34_3 __ctx3__ = (____scope34_3)_stateMgrs[3];

            switch (__seg__.Progress)
            {
            case 0:
                if ( !PreProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[11],__eventData[2],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 1;
            case 1:
                if (!NZMetadataExtractorPort.GetMessageId(__ctx0__.__subWrapper1.getSubscription(this), __seg__, __ctx1__, out __msgEnv__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if (__ctx1__.__NZMetadataMsg != null)
                    __ctx1__.UnrefMessage(__ctx1__.__NZMetadataMsg);
                __ctx1__.__NZMetadataMsg = new PeDALS.Orchestrations.NZMetadataMessageType("NZMetadataMsg", __ctx1__);
                __ctx1__.RefMessage(__ctx1__.__NZMetadataMsg);
                NZMetadataExtractorPort.ReceiveMessage(0, __msgEnv__, __ctx1__.__NZMetadataMsg, new Microsoft.XLANGs.Core.Correlation[] { __ctx1__.__RecvPortId }, (Microsoft.XLANGs.Core.Context)_stateMgrs[1], __seg__);
                if ( !PostProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Receive);
                    __edata.Messages.Add(__ctx1__.__NZMetadataMsg);
                    __edata.PortName = @"NZMetadataExtractorPort";
                    Tracker.FireEvent(__eventLocations[12],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                if ( !PreProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[13],__eventData[3],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 4;
            case 4:
                __ctx3__ = new ____scope34_3(this);
                _stateMgrs[3] = __ctx3__;
                if ( !PostProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 5;
            case 5:
                __ctx1__.StartContext(__seg__, __ctx3__);
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 6:
                if ( !PreProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[18],__eventData[6],_stateMgrs[1].TrackDataStream );
                __ctx3__.Finally();
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 7;
            case 7:
                __seg__.SegmentDone();
                _segments[1].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment5(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[5];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[3];
            __PSCOrders_1 __ctx1__ = (__PSCOrders_1)_stateMgrs[1];
            ____scope34_3 __ctx3__ = (____scope34_3)_stateMgrs[3];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx3__.__metadataXml = new Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy();
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                __ctx3__.__metadataXml.UnderlyingXmlDocument = new System.Xml.XmlDocument();
                if ( !PostProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[16],__eventData[4],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                __ctx3__.__metadataXml.UnderlyingXmlDocument = __ctx1__.__NZMetadataMsg.Body.TypedValue;
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[17],__eventData[5],_stateMgrs[3].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                __ctx1__.__metadataCount = PeDALS.Utilities.XmlHelper.GetNodeCount((System.Xml.XmlDocument)__ctx3__.__metadataXml.UnderlyingXmlDocument, "/*[local-name()='Object' and namespace-uri()='']/*[local-name()='Files' and namespace-uri()='']/*[local-name()='Folder' and namespace-uri()='']/*[local-name()='File' and namespace-uri()='']");
                if (__ctx3__ != null)
                    __ctx3__.__metadataXml = null;
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                System.Diagnostics.Debug.WriteLine("Metadata Count: " + System.Convert.ToString(__ctx1__.__metadataCount));
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                if (!__ctx3__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 8;
            case 8:
                if ( !PreProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx3__.OnCommit();
                goto case 9;
            case 9:
                __seg__.SegmentDone();
                _segments[4].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment6(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Envelope __msgEnv__ = null;
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[6];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[1];
            __PSCOrders_1 __ctx1__ = (__PSCOrders_1)_stateMgrs[1];
            __PSCOrders_root_0 __ctx0__ = (__PSCOrders_root_0)_stateMgrs[0];
            ____scope35_4 __ctx4__ = (____scope35_4)_stateMgrs[4];

            switch (__seg__.Progress)
            {
            case 0:
                if ( !PreProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[19],__eventData[2],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 1;
            case 1:
                if (!OrdersPort.GetMessageId(__ctx0__.__subWrapper2.getSubscription(this), __seg__, __ctx1__, out __msgEnv__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if (__ctx1__.__PscOrdersMsg != null)
                    __ctx1__.UnrefMessage(__ctx1__.__PscOrdersMsg);
                __ctx1__.__PscOrdersMsg = new PublicServiceCommissionOrdersMetadataMessageType("PscOrdersMsg", __ctx1__);
                __ctx1__.RefMessage(__ctx1__.__PscOrdersMsg);
                OrdersPort.ReceiveMessage(0, __msgEnv__, __ctx1__.__PscOrdersMsg, new Microsoft.XLANGs.Core.Correlation[] { __ctx1__.__RecvPortId }, (Microsoft.XLANGs.Core.Context)_stateMgrs[1], __seg__);
                if ( !PostProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Receive);
                    __edata.Messages.Add(__ctx1__.__PscOrdersMsg);
                    __edata.PortName = @"OrdersPort";
                    Tracker.FireEvent(__eventLocations[20],__edata,_stateMgrs[1].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                if ( !PreProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[21],__eventData[3],_stateMgrs[1].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 4;
            case 4:
                __ctx4__ = new ____scope35_4(this);
                _stateMgrs[4] = __ctx4__;
                if ( !PostProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 5;
            case 5:
                __ctx1__.StartContext(__seg__, __ctx4__);
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 6:
                if ( !PreProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[26],__eventData[6],_stateMgrs[1].TrackDataStream );
                __ctx4__.Finally();
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 7;
            case 7:
                __seg__.SegmentDone();
                _segments[1].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment7(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[7];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[4];
            __PSCOrders_1 __ctx1__ = (__PSCOrders_1)_stateMgrs[1];
            ____scope35_4 __ctx4__ = (____scope35_4)_stateMgrs[4];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx4__.__ordersXml = new Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy();
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                __ctx4__.__ordersXml.UnderlyingXmlDocument = new System.Xml.XmlDocument();
                if ( !PostProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[24],__eventData[4],_stateMgrs[4].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                __ctx4__.__ordersXml.UnderlyingXmlDocument = __ctx1__.__PscOrdersMsg.Body.TypedValue;
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[25],__eventData[5],_stateMgrs[4].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                __ctx1__.__orderCount = PeDALS.Utilities.XmlHelper.GetNodeCount((System.Xml.XmlDocument)__ctx4__.__ordersXml.UnderlyingXmlDocument, "/*[local-name()='orders' and namespace-uri()='']/*[local-name()='order' and namespace-uri()='']");
                if (__ctx4__ != null)
                    __ctx4__.__ordersXml = null;
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                System.Diagnostics.Debug.WriteLine("Order Count: " + System.Convert.ToString(__ctx1__.__orderCount));
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                if (!__ctx4__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 8;
            case 8:
                if ( !PreProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx4__.OnCommit();
                goto case 9;
            case 9:
                __seg__.SegmentDone();
                _segments[6].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment8(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[8];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[5];
            __PSCOrders_1 __ctx1__ = (__PSCOrders_1)_stateMgrs[1];
            __PSCOrders_root_0 __ctx0__ = (__PSCOrders_root_0)_stateMgrs[0];
            ____scope36_5 __ctx5__ = (____scope36_5)_stateMgrs[5];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx5__.__zero = default(System.Int32);
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                __ctx5__.__zero = 0;
                if ( !PostProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[31],__eventData[4],_stateMgrs[5].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                System.Diagnostics.Debug.WriteLine("Ingest counts do not match");
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[32],__eventData[5],_stateMgrs[5].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                System.Diagnostics.Debug.WriteLine("Throwing Exception");
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                System.Diagnostics.Debug.WriteLine("##############");
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                if ( !PreProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[33],__eventData[9],_stateMgrs[5].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 8;
            case 8:
                {
                    __messagetype_System_Xml_XmlDocument __NotificationMsg = new __messagetype_System_Xml_XmlDocument("NotificationMsg", __ctx5__);

                    __NotificationMsg.part.LoadFrom(new System.Xml.XmlDocument());
                    __NotificationMsg.part.TypedValue.LoadXml("<Notification><Type>Warning</Type><Metadata><ProvenanceId>" + (System.String)__ctx1__.__NZMetadataMsg.Body.GetDistinguishedField("Name") + "</ProvenanceId><SeriesId>" + System.Convert.ToString((System.Int32)__ctx1__.__NZMetadataMsg.Body.GetDistinguishedField("ID")) + "</SeriesId><SeriesAcquisitionId>" + System.Convert.ToString((System.Int32)__ctx1__.__NZMetadataMsg.Body.GetDistinguishedField("GroupIdentifier")) + "</SeriesAcquisitionId><ItemId>Unknown</ItemId></Metadata><Message>Shipping manifest and NZMetadataExtractor counts do not match.</Message></Notification>");

                    if (__ctx5__.__NotificationMsg != null)
                        __ctx5__.UnrefMessage(__ctx5__.__NotificationMsg);
                    __ctx5__.__NotificationMsg = __NotificationMsg;
                    __ctx5__.RefMessage(__ctx5__.__NotificationMsg);
                }
                __ctx5__.__NotificationMsg.ConstructionCompleteEvent(false);
                if ( !PostProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 9;
            case 9:
                if ( !PreProgressInc( __seg__, __ctx__, 10 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Construct);
                    __edata.Messages.Add(__ctx5__.__NotificationMsg);
                    Tracker.FireEvent(__eventLocations[34],__edata,_stateMgrs[5].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 10;
            case 10:
                if ( !PreProgressInc( __seg__, __ctx__, 11 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[35],__eventData[10],_stateMgrs[5].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 11;
            case 11:
                if (!__ctx5__.PrepareToPendingCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 12 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 12;
            case 12:
                if ( !PreProgressInc( __seg__, __ctx__, 13 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                PublishNotificationPort.SendMessage(0, __ctx5__.__NotificationMsg, null, null, __ctx5__, __seg__ , Microsoft.XLANGs.Core.ActivityFlags.NextActivityPersists );
                if ((stopOn & Microsoft.XLANGs.Core.StopConditions.OutgoingRqst) != 0)
                    return Microsoft.XLANGs.Core.StopConditions.OutgoingRqst;
                goto case 13;
            case 13:
                if ( !PreProgressInc( __seg__, __ctx__, 14 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Send);
                    __edata.Messages.Add(__ctx5__.__NotificationMsg);
                    __edata.PortName = @"PublishNotificationPort";
                    Tracker.FireEvent(__eventLocations[36],__edata,_stateMgrs[5].TrackDataStream );
                }
                if (__ctx5__ != null && __ctx5__.__NotificationMsg != null)
                {
                    __ctx5__.UnrefMessage(__ctx5__.__NotificationMsg);
                    __ctx5__.__NotificationMsg = null;
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 14;
            case 14:
                if (!__ctx5__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 15 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 15;
            case 15:
                if ( !PreProgressInc( __seg__, __ctx__, 16 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx5__.OnCommit();
                goto case 16;
            case 16:
                __seg__.SegmentDone();
                _segments[1].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment9(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[9];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[6];
            __PSCOrders_1 __ctx1__ = (__PSCOrders_1)_stateMgrs[1];
            __Transaction_5_6 __ctx6__ = (__Transaction_5_6)_stateMgrs[6];
            ____scope39_7 __ctx7__ = (____scope39_7)_stateMgrs[7];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx6__.__BaseAipMsg = __ctx1__.__BaseAipMsg;
                if (__ctx6__.__BaseAipMsg != null)
                    __ctx6__.RefMessage(__ctx6__.__BaseAipMsg);
                __ctx6__.__superPackageId = __ctx1__.__superPackageId;
                __ctx6__.__seriesId = __ctx1__.__seriesId;
                __ctx6__.__seriesAcquisitionId = __ctx1__.__seriesAcquisitionId;
                __ctx6__.__seriesAcquisitionDir = __ctx1__.__seriesAcquisitionDir;
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[42],__eventData[13],_stateMgrs[6].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                {
                    Microsoft.XLANGs.Core.Service svc = new PeDALS.Orchestrations.GetInitialValues(12, InstanceId, this);
                    _stateMgrs[12] = svc;
                    __ctx6__.StartCall(__seg__, svc, __eventLocations[42],new object[] {new Microsoft.XLANGs.Core.MessageTuple((Microsoft.XLANGs.Core.Context)_stateMgrs[6], null), __ctx1__.__NZMetadataMsg});
                }
                if ( !PostProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 3:
                if ( !PreProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    object[] args = ((Microsoft.XLANGs.Core.Service)_stateMgrs[12]).Args;
                    __ctx6__.__BaseAipMsg = (PeDALS.Orchestrations.AchivalIngestPackageMessageType)((Microsoft.XLANGs.Core.MessageTuple)(args[0])).message;
                    __ctx6__.__BaseAipMsg.MessageName = "BaseAipMsg";
                }
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Call);
                    __edata.Messages.Add(__ctx6__.__BaseAipMsg);
                    __edata.Messages.Add(__ctx1__.__NZMetadataMsg);
                    Tracker.FireEvent(__eventLocations[43],__edata,_stateMgrs[6].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 4;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[44],__eventData[3],_stateMgrs[6].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                __ctx7__ = new ____scope39_7(this);
                _stateMgrs[7] = __ctx7__;
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                __ctx6__.StartContext(__seg__, __ctx7__);
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 7:
                if ( !PreProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[55],__eventData[6],_stateMgrs[6].TrackDataStream );
                __ctx7__.Finally();
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 8;
            case 8:
                if (!__ctx6__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 9;
            case 9:
                if ( !PreProgressInc( __seg__, __ctx__, 10 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx6__.OnCommit();
                goto case 10;
            case 10:
                __seg__.SegmentDone();
                _segments[1].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment10(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[10];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[7];
            __Transaction_5_6 __ctx6__ = (__Transaction_5_6)_stateMgrs[6];
            ____scope39_7 __ctx7__ = (____scope39_7)_stateMgrs[7];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[46],__eventData[4],_stateMgrs[7].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                __ctx6__.__superPackageId = (System.String)__ctx6__.__BaseAipMsg.Body.GetDistinguishedField("SuperPackageId");
                if ( !PostProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 3;
            case 3:
                if ( !PreProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[47],__eventData[5],_stateMgrs[7].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 4;
            case 4:
                __ctx6__.__seriesId = (System.Int32)__ctx6__.__BaseAipMsg.Body.GetDistinguishedField("CoreMetadata.Provenance.Series.SeriesId");
                if ( !PostProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 5;
            case 5:
                __ctx6__.__seriesAcquisitionId = (System.Int32)__ctx6__.__BaseAipMsg.Body.GetDistinguishedField("CoreMetadata.Provenance.Series.Acquisition.SeriesAcquisitionId");
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                __ctx6__.__seriesAcquisitionDir = (System.String)__ctx6__.__BaseAipMsg.Body.GetDistinguishedField("CoreMetadata.Provenance.Series.Acquisition.SeriesAcquisitionDirectory");
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                if (!__ctx7__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 8;
            case 8:
                if ( !PreProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx7__.OnCommit();
                goto case 9;
            case 9:
                __seg__.SegmentDone();
                _segments[9].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment11(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[11];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[7];
            ____scope39_7 __ctx7__ = (____scope39_7)_stateMgrs[7];

            switch (__seg__.Progress)
            {
            case 0:
                OnBeginCatchHandler(7);
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[49],__eventData[15],_stateMgrs[7].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[50],__eventData[16],_stateMgrs[7].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                throw new System.ApplicationException("Missing data returned from database.  ItemId and SourcePath could not be set.  Are you sure the ProvenanceId, SeriesId, and SeriesAcquisitionId exists?", __ctx7__.__ex_0);
                if (__ctx7__ != null)
                    __ctx7__.__ex_0 = null;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[51],__eventData[17],_stateMgrs[7].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                __ctx7__.__exv__ = null;
                OnEndCatchHandler(7, __seg__);
                __seg__.SegmentDone();
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment12(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[12];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[7];
            ____scope39_7 __ctx7__ = (____scope39_7)_stateMgrs[7];

            switch (__seg__.Progress)
            {
            case 0:
                OnBeginCatchHandler(7);
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[52],__eventData[15],_stateMgrs[7].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                if ( !PreProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[53],__eventData[16],_stateMgrs[7].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 3;
            case 3:
                throw new System.ApplicationException("Malformed data.  Is series acquisition id in an integer format?", __ctx7__.__ex_1);
                if (__ctx7__ != null)
                    __ctx7__.__ex_1 = null;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[54],__eventData[17],_stateMgrs[7].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                __ctx7__.__exv__ = null;
                OnEndCatchHandler(7, __seg__);
                __seg__.SegmentDone();
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment13(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            bool __condition__;
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[13];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[8];
            __PSCOrders_1 __ctx1__ = (__PSCOrders_1)_stateMgrs[1];
            __PSCOrders_root_0 __ctx0__ = (__PSCOrders_root_0)_stateMgrs[0];
            __Transaction_3_10 __ctx10__ = (__Transaction_3_10)_stateMgrs[10];
            ____scope40_9 __ctx9__ = (____scope40_9)_stateMgrs[9];
            __Transaction_2_8 __ctx8__ = (__Transaction_2_8)_stateMgrs[8];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx8__.__recCount = default(System.Int32);
                __ctx8__.__ManifestCompleteMsg = __ctx1__.__ManifestCompleteMsg;
                if (__ctx8__.__ManifestCompleteMsg != null)
                    __ctx8__.RefMessage(__ctx8__.__ManifestCompleteMsg);
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                if ( !PreProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[59],__eventData[4],_stateMgrs[8].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 2;
            case 2:
                __ctx8__.__recCount = 1;
                if ( !PostProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 3;
            case 3:
                if ( !PreProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[60],__eventData[5],_stateMgrs[8].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 4;
            case 4:
                if ( !PreProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[61],__eventData[18],_stateMgrs[8].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 5;
            case 5:
                __condition__ = __ctx8__.__recCount <= __ctx1__.__manifestCount + 1;
                if (!__condition__)
                {
                    if ( !PostProgressInc( __seg__, __ctx__, 20 ) )
                        return Microsoft.XLANGs.Core.StopConditions.Paused;
                    goto case 20;
                }
                if ( !PostProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 6;
            case 6:
                if ( !PreProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[61],__eventData[19],_stateMgrs[8].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 7;
            case 7:
                if ( !PreProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[62],__eventData[3],_stateMgrs[8].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 8;
            case 8:
                __ctx9__ = new ____scope40_9(this);
                _stateMgrs[9] = __ctx9__;
                if ( !PostProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 9;
            case 9:
                __ctx8__.StartContext(__seg__, __ctx9__);
                if ( !PostProgressInc( __seg__, __ctx__, 10 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 10:
                if ( !PreProgressInc( __seg__, __ctx__, 11 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[67],__eventData[6],_stateMgrs[8].TrackDataStream );
                __ctx9__.Finally();
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 11;
            case 11:
                if ( !PreProgressInc( __seg__, __ctx__, 12 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[68],__eventData[3],_stateMgrs[8].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 12;
            case 12:
                __ctx10__ = new __Transaction_3_10(this);
                _stateMgrs[10] = __ctx10__;
                if ( !PostProgressInc( __seg__, __ctx__, 13 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 13;
            case 13:
                __ctx8__.StartContext(__seg__, __ctx10__);
                if ( !PostProgressInc( __seg__, __ctx__, 14 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 14:
                if ( !PreProgressInc( __seg__, __ctx__, 15 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[87],__eventData[6],_stateMgrs[8].TrackDataStream );
                __ctx10__.Finally();
                if (__ctx10__ != null && __ctx10__.__NZMetadataFileMsg != null)
                {
                    __ctx10__.UnrefMessage(__ctx10__.__NZMetadataFileMsg);
                    __ctx10__.__NZMetadataFileMsg = null;
                }
                if (__ctx10__ != null && __ctx10__.__OrderMsg != null)
                {
                    __ctx10__.UnrefMessage(__ctx10__.__OrderMsg);
                    __ctx10__.__OrderMsg = null;
                }
                if (__ctx8__ != null && __ctx8__.__NZMetadataFileMsg != null)
                {
                    __ctx8__.UnrefMessage(__ctx8__.__NZMetadataFileMsg);
                    __ctx8__.__NZMetadataFileMsg = null;
                }
                if (__ctx1__ != null && __ctx1__.__OrderMsg != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__OrderMsg);
                    __ctx1__.__OrderMsg = null;
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 15;
            case 15:
                if ( !PreProgressInc( __seg__, __ctx__, 16 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[88],__eventData[4],_stateMgrs[8].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 16;
            case 16:
                __ctx8__.__recCount = __ctx8__.__recCount + 1;
                if ( !PostProgressInc( __seg__, __ctx__, 17 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 17;
            case 17:
                if ( !PreProgressInc( __seg__, __ctx__, 18 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[89],__eventData[5],_stateMgrs[8].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 18;
            case 18:
                if ( !PreProgressInc( __seg__, __ctx__, 19 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[90],__eventData[20],_stateMgrs[8].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 19;
            case 19:
                if ( !PostProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 5;
            case 20:
                if ( !PreProgressInc( __seg__, __ctx__, 21 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                if (__ctx1__ != null && __ctx1__.__PscOrdersMsg != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__PscOrdersMsg);
                    __ctx1__.__PscOrdersMsg = null;
                }
                if (__ctx1__ != null && __ctx1__.__BaseAipMsg != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__BaseAipMsg);
                    __ctx1__.__BaseAipMsg = null;
                }
                if (__ctx1__ != null && __ctx1__.__NZMetadataMsg != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__NZMetadataMsg);
                    __ctx1__.__NZMetadataMsg = null;
                }
                if (__ctx1__ != null && __ctx1__.__PscManifestMsg != null)
                {
                    __ctx1__.UnrefMessage(__ctx1__.__PscManifestMsg);
                    __ctx1__.__PscManifestMsg = null;
                }
                Tracker.FireEvent(__eventLocations[90],__eventData[21],_stateMgrs[8].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 21;
            case 21:
                if ( !PreProgressInc( __seg__, __ctx__, 22 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[91],__eventData[9],_stateMgrs[8].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 22;
            case 22:
                {
                    __messagetype_PeDALS_Schema_AIP_ManifestComplete __ManifestCompleteMsg = new __messagetype_PeDALS_Schema_AIP_ManifestComplete("ManifestCompleteMsg", __ctx8__);

                    __ctx1__.__doc.UnderlyingXmlDocument = new System.Xml.XmlDocument();
                    __ctx1__.__doc.UnderlyingXmlDocument.LoadXml("<ns0:Manifest xmlns:ns0=\"http://PeDALS.Schema\"" + " SeriesAcquisitionId=\"" + __ctx1__.__seriesAcquisitionId.ToString() + "\"" + " SeriesId=\"" + __ctx1__.__seriesId.ToString() + "\"" + " SuperPackageId=\"" + __ctx1__.__superPackageId + "\"" + " SeriesAcquisitionDir=\"" + __ctx1__.__seriesAcquisitionDir + "\"/>");
                    if (__ctx1__ != null)
                        __ctx1__.__superPackageId = null;
                    if (__ctx1__ != null)
                        __ctx1__.__seriesAcquisitionDir = null;
                    __ManifestCompleteMsg.part.LoadFrom((System.Xml.XmlDocument)__ctx1__.__doc.UnderlyingXmlDocument);
                    if (__ctx1__ != null)
                        __ctx1__.__doc = null;

                    if (__ctx8__.__ManifestCompleteMsg != null)
                        __ctx8__.UnrefMessage(__ctx8__.__ManifestCompleteMsg);
                    __ctx8__.__ManifestCompleteMsg = __ManifestCompleteMsg;
                    __ctx8__.RefMessage(__ctx8__.__ManifestCompleteMsg);
                }
                __ctx8__.__ManifestCompleteMsg.ConstructionCompleteEvent(false);
                if ( !PostProgressInc( __seg__, __ctx__, 23 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 23;
            case 23:
                if ( !PreProgressInc( __seg__, __ctx__, 24 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Construct);
                    __edata.Messages.Add(__ctx8__.__ManifestCompleteMsg);
                    Tracker.FireEvent(__eventLocations[92],__edata,_stateMgrs[8].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 24;
            case 24:
                if ( !PreProgressInc( __seg__, __ctx__, 25 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[93],__eventData[10],_stateMgrs[8].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 25;
            case 25:
                if (!__ctx8__.PrepareToPendingCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 26 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 26;
            case 26:
                if ( !PreProgressInc( __seg__, __ctx__, 27 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                ManifestCompletePort.SendMessage(0, __ctx8__.__ManifestCompleteMsg, null, null, __ctx8__, __seg__ , Microsoft.XLANGs.Core.ActivityFlags.NextActivityPersists );
                if (ManifestCompletePort != null)
                {
                    ManifestCompletePort.Close(__ctx8__, __seg__);
                    ManifestCompletePort = null;
                }
                if ((stopOn & Microsoft.XLANGs.Core.StopConditions.OutgoingRqst) != 0)
                    return Microsoft.XLANGs.Core.StopConditions.OutgoingRqst;
                goto case 27;
            case 27:
                if ( !PreProgressInc( __seg__, __ctx__, 28 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Send);
                    __edata.Messages.Add(__ctx8__.__ManifestCompleteMsg);
                    __edata.PortName = @"ManifestCompletePort";
                    Tracker.FireEvent(__eventLocations[94],__edata,_stateMgrs[8].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 28;
            case 28:
                if (!__ctx8__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 29 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 29;
            case 29:
                if ( !PreProgressInc( __seg__, __ctx__, 30 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx8__.OnCommit();
                goto case 30;
            case 30:
                __seg__.SegmentDone();
                _segments[1].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment14(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[14];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[9];
            __PSCOrders_1 __ctx1__ = (__PSCOrders_1)_stateMgrs[1];
            ____scope40_9 __ctx9__ = (____scope40_9)_stateMgrs[9];
            __Transaction_2_8 __ctx8__ = (__Transaction_2_8)_stateMgrs[8];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx9__.__xmlManifest = new Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy();
                __ctx9__.__xmlTemp = new Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy();
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                __ctx9__.__xmlManifest.UnderlyingXmlDocument = new System.Xml.XmlDocument();
                if ( !PostProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 2;
            case 2:
                __ctx9__.__xmlTemp.UnderlyingXmlDocument = new System.Xml.XmlDocument();
                if ( !PostProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 3;
            case 3:
                if ( !PreProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[65],__eventData[9],_stateMgrs[9].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 4;
            case 4:
                {
                    PublicServiceCommissionOrdersFileMessageType __ManifestFileMsg = new PublicServiceCommissionOrdersFileMessageType("ManifestFileMsg", __ctx8__);

                    __ctx9__.__xmlManifest.UnderlyingXmlDocument = __ctx1__.__PscManifestMsg.Body.TypedValue;
                    __ctx9__.__xmlTemp.UnderlyingXmlDocument = PeDALS.Utilities.XmlHelper.GetNodeAsXML((System.Xml.XmlDocument)__ctx9__.__xmlManifest.UnderlyingXmlDocument, "/*[local-name()='manifest' and namespace-uri()='']/*[local-name()='file' and namespace-uri()=''][" + System.Convert.ToString(__ctx8__.__recCount) + "]");
                    if (__ctx9__ != null)
                        __ctx9__.__xmlManifest = null;
                    System.Diagnostics.Debug.WriteLine("Single Manifest File");
                    System.Diagnostics.Debug.WriteLine(__ctx9__.__xmlTemp.UnderlyingXmlDocument.OuterXml);
                    System.Diagnostics.Debug.WriteLine("!!!!!!!!!!!!!!!!!!!!!!");
                    __ManifestFileMsg.Body.LoadFrom((System.Xml.XmlDocument)__ctx9__.__xmlTemp.UnderlyingXmlDocument);
                    if (__ctx9__ != null)
                        __ctx9__.__xmlTemp = null;

                    if (__ctx8__.__ManifestFileMsg != null)
                        __ctx8__.UnrefMessage(__ctx8__.__ManifestFileMsg);
                    __ctx8__.__ManifestFileMsg = __ManifestFileMsg;
                    __ctx8__.RefMessage(__ctx8__.__ManifestFileMsg);
                }
                __ctx8__.__ManifestFileMsg.ConstructionCompleteEvent(false);
                if ( !PostProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 5;
            case 5:
                if ( !PreProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Construct);
                    __edata.Messages.Add(__ctx8__.__ManifestFileMsg);
                    Tracker.FireEvent(__eventLocations[66],__edata,_stateMgrs[9].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 6;
            case 6:
                if (!__ctx9__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                if ( !PreProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx9__.OnCommit();
                goto case 8;
            case 8:
                __seg__.SegmentDone();
                _segments[13].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment15(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            bool __condition__;
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[15];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[10];
            __PSCOrders_1 __ctx1__ = (__PSCOrders_1)_stateMgrs[1];
            __Transaction_3_10 __ctx10__ = (__Transaction_3_10)_stateMgrs[10];
            __Transaction_2_8 __ctx8__ = (__Transaction_2_8)_stateMgrs[8];
            __Transaction_4_11 __ctx11__ = (__Transaction_4_11)_stateMgrs[11];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx10__.__fileName = default(System.String);
                __ctx10__.__projType = default(System.String);
                __ctx10__.__xmlOrderMsg = new Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy();
                __ctx10__.__tempXML = new Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy();
                __ctx10__.__NZMetadataFileMsg = __ctx8__.__NZMetadataFileMsg;
                if (__ctx10__.__NZMetadataFileMsg != null)
                    __ctx10__.RefMessage(__ctx10__.__NZMetadataFileMsg);
                __ctx10__.__OrderMsg = __ctx1__.__OrderMsg;
                if (__ctx10__.__OrderMsg != null)
                    __ctx10__.RefMessage(__ctx10__.__OrderMsg);
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                __ctx10__.__fileName = "";
                if ( !PostProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 2;
            case 2:
                __ctx10__.__projType = "";
                if ( !PostProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 3;
            case 3:
                __ctx10__.__xmlOrderMsg.UnderlyingXmlDocument = new System.Xml.XmlDocument();
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                __ctx10__.__tempXML.UnderlyingXmlDocument = new System.Xml.XmlDocument();
                if ( !PostProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 5;
            case 5:
                if ( !PreProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[71],__eventData[4],_stateMgrs[10].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 6;
            case 6:
                __ctx10__.__fileName = (System.String)__ctx8__.__ManifestFileMsg.Body.GetDistinguishedField("filename");
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                if ( !PreProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[72],__eventData[5],_stateMgrs[10].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 8;
            case 8:
                System.Diagnostics.Debug.WriteLine("Next File to Work with");
                if ( !PostProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 9;
            case 9:
                System.Diagnostics.Debug.WriteLine(__ctx10__.__fileName);
                if ( !PostProgressInc( __seg__, __ctx__, 10 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 10;
            case 10:
                System.Diagnostics.Debug.WriteLine("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
                if ( !PostProgressInc( __seg__, __ctx__, 11 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 11;
            case 11:
                __ctx10__.__projType = "Cert";
                if (__ctx10__ != null)
                    __ctx10__.__projType = null;
                if ( !PostProgressInc( __seg__, __ctx__, 12 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 12;
            case 12:
                if ( !PreProgressInc( __seg__, __ctx__, 13 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[73],__eventData[8],_stateMgrs[10].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 13;
            case 13:
                __condition__ = __ctx10__.__fileName.EndsWith(".pdf");
                if (!__condition__)
                {
                    if ( !PostProgressInc( __seg__, __ctx__, 24 ) )
                        return Microsoft.XLANGs.Core.StopConditions.Paused;
                    goto case 24;
                }
                if ( !PostProgressInc( __seg__, __ctx__, 14 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 14;
            case 14:
                if ( !PreProgressInc( __seg__, __ctx__, 15 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[74],__eventData[13],_stateMgrs[10].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 15;
            case 15:
                {
                    Microsoft.XLANGs.Core.Service svc = new PeDALS.Orchestrations.SplitNZMetadataMessage(13, InstanceId, this);
                    _stateMgrs[13] = svc;
                    __ctx10__.StartCall(__seg__, svc, __eventLocations[74],new object[] {new Microsoft.XLANGs.Core.MessageTuple((Microsoft.XLANGs.Core.Context)_stateMgrs[10], null), __ctx1__.__NZMetadataMsg, __ctx10__.__fileName});
                }
                if ( !PostProgressInc( __seg__, __ctx__, 16 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 16:
                if ( !PreProgressInc( __seg__, __ctx__, 17 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    object[] args = ((Microsoft.XLANGs.Core.Service)_stateMgrs[13]).Args;
                    __ctx10__.__NZMetadataFileMsg = (PeDALS.Orchestrations.NZMetadataFileMessageType)((Microsoft.XLANGs.Core.MessageTuple)(args[0])).message;
                    __ctx10__.__NZMetadataFileMsg.MessageName = "NZMetadataFileMsg";
                }
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Call);
                    __edata.Messages.Add(__ctx10__.__NZMetadataFileMsg);
                    __edata.Messages.Add(__ctx1__.__NZMetadataMsg);
                    Tracker.FireEvent(__eventLocations[75],__edata,_stateMgrs[10].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 17;
            case 17:
                if ( !PreProgressInc( __seg__, __ctx__, 18 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[76],__eventData[9],_stateMgrs[10].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 18;
            case 18:
                {
                    __messagetype_PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Order __OrderMsg = new __messagetype_PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Order("OrderMsg", __ctx10__);

                    __ctx10__.__fileName = __ctx10__.__fileName.Replace("data/", "");
                    __ctx10__.__xmlOrderMsg.UnderlyingXmlDocument = __ctx1__.__PscOrdersMsg.Body.TypedValue;
                    __ctx10__.__tempXML.UnderlyingXmlDocument = PeDALS.Utilities.XmlHelper.GetNodeAsXML((System.Xml.XmlDocument)__ctx10__.__xmlOrderMsg.UnderlyingXmlDocument, "//order[order_attachment='" + __ctx10__.__fileName + "']");
                    System.Diagnostics.Debug.WriteLine("Indvidual NZ Metadata File");
                    System.Diagnostics.Debug.WriteLine(__ctx10__.__tempXML.UnderlyingXmlDocument.OuterXml);
                    System.Diagnostics.Debug.WriteLine("**************************");
                    __OrderMsg.part.LoadFrom((System.Xml.XmlDocument)__ctx10__.__tempXML.UnderlyingXmlDocument);

                    if (__ctx10__.__OrderMsg != null)
                        __ctx10__.UnrefMessage(__ctx10__.__OrderMsg);
                    __ctx10__.__OrderMsg = __OrderMsg;
                    __ctx10__.RefMessage(__ctx10__.__OrderMsg);
                }
                __ctx10__.__OrderMsg.ConstructionCompleteEvent(false);
                if ( !PostProgressInc( __seg__, __ctx__, 19 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 19;
            case 19:
                if ( !PreProgressInc( __seg__, __ctx__, 20 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Construct);
                    __edata.Messages.Add(__ctx10__.__OrderMsg);
                    Tracker.FireEvent(__eventLocations[77],__edata,_stateMgrs[10].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 20;
            case 20:
                if ( !PreProgressInc( __seg__, __ctx__, 21 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[78],__eventData[3],_stateMgrs[10].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 21;
            case 21:
                __ctx11__ = new __Transaction_4_11(this);
                _stateMgrs[11] = __ctx11__;
                if ( !PostProgressInc( __seg__, __ctx__, 22 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 22;
            case 22:
                __ctx10__.StartContext(__seg__, __ctx11__);
                if ( !PostProgressInc( __seg__, __ctx__, 23 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 23:
                if ( !PreProgressInc( __seg__, __ctx__, 24 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[85],__eventData[6],_stateMgrs[10].TrackDataStream );
                __ctx11__.Finally();
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 24;
            case 24:
                if ( !PreProgressInc( __seg__, __ctx__, 25 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                if (__ctx10__ != null)
                    __ctx10__.__tempXML = null;
                if (__ctx10__ != null)
                    __ctx10__.__xmlOrderMsg = null;
                if (__ctx10__ != null)
                    __ctx10__.__fileName = null;
                if (__ctx8__ != null && __ctx8__.__ManifestFileMsg != null)
                {
                    __ctx8__.UnrefMessage(__ctx8__.__ManifestFileMsg);
                    __ctx8__.__ManifestFileMsg = null;
                }
                Tracker.FireEvent(__eventLocations[86],__eventData[12],_stateMgrs[10].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 25;
            case 25:
                if (!__ctx10__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 26 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 26;
            case 26:
                if ( !PreProgressInc( __seg__, __ctx__, 27 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx10__.OnCommit();
                goto case 27;
            case 27:
                __seg__.SegmentDone();
                _segments[13].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }

        public Microsoft.XLANGs.Core.StopConditions segment16(Microsoft.XLANGs.Core.StopConditions stopOn)
        {
            Microsoft.XLANGs.Core.Segment __seg__ = _segments[16];
            Microsoft.XLANGs.Core.Context __ctx__ = (Microsoft.XLANGs.Core.Context)_stateMgrs[11];
            __PSCOrders_1 __ctx1__ = (__PSCOrders_1)_stateMgrs[1];
            __Transaction_3_10 __ctx10__ = (__Transaction_3_10)_stateMgrs[10];
            __Transaction_2_8 __ctx8__ = (__Transaction_2_8)_stateMgrs[8];
            __Transaction_4_11 __ctx11__ = (__Transaction_4_11)_stateMgrs[11];

            switch (__seg__.Progress)
            {
            case 0:
                __ctx11__.__orgFileAsBase64 = default(System.String);
                __ctx11__.__temp = default(System.String);
                __ctx11__.__title = default(System.String);
                __ctx11__.__xmlTemp = new Microsoft.XLANGs.RuntimeTypes.XmlDocumentSerializationProxy();
                __ctx__.PrologueCompleted = true;
                if ( !PostProgressInc( __seg__, __ctx__, 1 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 1;
            case 1:
                __ctx11__.__orgFileAsBase64 = "";
                if ( !PostProgressInc( __seg__, __ctx__, 2 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 2;
            case 2:
                __ctx11__.__temp = "";
                if (__ctx11__ != null)
                    __ctx11__.__temp = null;
                if ( !PostProgressInc( __seg__, __ctx__, 3 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 3;
            case 3:
                __ctx11__.__title = "";
                if (__ctx11__ != null)
                    __ctx11__.__title = null;
                if ( !PostProgressInc( __seg__, __ctx__, 4 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 4;
            case 4:
                __ctx11__.__xmlTemp.UnderlyingXmlDocument = new System.Xml.XmlDocument();
                if ( !PostProgressInc( __seg__, __ctx__, 5 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 5;
            case 5:
                if ( !PreProgressInc( __seg__, __ctx__, 6 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[81],__eventData[9],_stateMgrs[11].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 6;
            case 6:
                {
                    PeDALS.Orchestrations.AchivalIngestPackageMessageType __FinalAIPMsg = new PeDALS.Orchestrations.AchivalIngestPackageMessageType("FinalAIPMsg", __ctx11__);

                    ApplyTransform(typeof(PeDALS.SC.Orchestrations.TransformBaseAipOrgMetadata_NZMetadataToFinalAIP), new object[] {__FinalAIPMsg.Body}, new object[] {__ctx1__.__BaseAipMsg.Body, __ctx10__.__OrderMsg.part, __ctx10__.__NZMetadataFileMsg.Body, __ctx8__.__ManifestFileMsg.Body});
                    __ctx11__.__orgFileAsBase64 = PeDALS.Utilities.Base64.Encode.PdfFile(__ctx1__.__seriesAcquisitionDir + "\\Data\\" + __ctx10__.__fileName);
                    __FinalAIPMsg.Body.XPathStore(__ctx11__.__xmlTemp.UnderlyingXmlDocument.OuterXml, "/*[local-name()='AIP' and namespace-uri()='http://PeDALS']/*[local-name()='OriginalMetadata' and namespace-uri()='']");
                    if (__ctx11__ != null)
                        __ctx11__.__xmlTemp = null;
                    __FinalAIPMsg.Body.XPathStore(__ctx11__.__orgFileAsBase64, "/*[local-name()='AIP' and namespace-uri()='http://PeDALS']/*[local-name()='OriginalRecord' and namespace-uri()='']");
                    if (__ctx11__ != null)
                        __ctx11__.__orgFileAsBase64 = null;

                    if (__ctx11__.__FinalAIPMsg != null)
                        __ctx11__.UnrefMessage(__ctx11__.__FinalAIPMsg);
                    __ctx11__.__FinalAIPMsg = __FinalAIPMsg;
                    __ctx11__.RefMessage(__ctx11__.__FinalAIPMsg);
                }
                __ctx11__.__FinalAIPMsg.ConstructionCompleteEvent(true);
                if ( !PostProgressInc( __seg__, __ctx__, 7 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 7;
            case 7:
                if ( !PreProgressInc( __seg__, __ctx__, 8 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Construct);
                    __edata.Messages.Add(__ctx11__.__FinalAIPMsg);
                    __edata.Messages.Add(__ctx1__.__BaseAipMsg);
                    __edata.Messages.Add(__ctx10__.__OrderMsg);
                    __edata.Messages.Add(__ctx10__.__NZMetadataFileMsg);
                    __edata.Messages.Add(__ctx8__.__ManifestFileMsg);
                    Tracker.FireEvent(__eventLocations[82],__edata,_stateMgrs[11].TrackDataStream );
                }
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 8;
            case 8:
                if ( !PreProgressInc( __seg__, __ctx__, 9 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                Tracker.FireEvent(__eventLocations[83],__eventData[13],_stateMgrs[11].TrackDataStream );
                if (IsDebugged)
                    return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                goto case 9;
            case 9:
                {
                    Microsoft.XLANGs.Core.Service svc = new PeDALS.Orchestrations.InsertAIP(14, InstanceId, this);
                    _stateMgrs[14] = svc;
                    __ctx11__.StartCall(__seg__, svc, __eventLocations[83],new object[] {__ctx11__.__FinalAIPMsg});
                }
                if ( !PostProgressInc( __seg__, __ctx__, 10 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                return Microsoft.XLANGs.Core.StopConditions.Blocked;
            case 10:
                {
                    object[] args = ((Microsoft.XLANGs.Core.Service)_stateMgrs[14]).Args;
                }
                {
                    Microsoft.XLANGs.RuntimeTypes.EventData __edata = new Microsoft.XLANGs.RuntimeTypes.EventData(Microsoft.XLANGs.RuntimeTypes.Operation.End | Microsoft.XLANGs.RuntimeTypes.Operation.Call);
                    __edata.Messages.Add(__ctx11__.__FinalAIPMsg);
                    Tracker.FireEvent(__eventLocations[84],__edata,_stateMgrs[11].TrackDataStream );
                }
                if (__ctx11__ != null && __ctx11__.__FinalAIPMsg != null)
                {
                    __ctx11__.UnrefMessage(__ctx11__.__FinalAIPMsg);
                    __ctx11__.__FinalAIPMsg = null;
                }
                if ( !PostProgressInc( __seg__, __ctx__, 11 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 11;
            case 11:
                if (!__ctx11__.CleanupAndPrepareToCommit(__seg__))
                    return Microsoft.XLANGs.Core.StopConditions.Blocked;
                if ( !PostProgressInc( __seg__, __ctx__, 12 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                goto case 12;
            case 12:
                if ( !PreProgressInc( __seg__, __ctx__, 13 ) )
                    return Microsoft.XLANGs.Core.StopConditions.Paused;
                __ctx11__.OnCommit();
                goto case 13;
            case 13:
                __seg__.SegmentDone();
                _segments[15].PredecessorDone(this);
                break;
            }
            return Microsoft.XLANGs.Core.StopConditions.Completed;
        }
    }

    [System.SerializableAttribute]
    sealed public class __PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Order__ : Microsoft.XLANGs.Core.XSDPart
    {
        private static PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Order _schema = new PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Order();

        public __PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Order__(Microsoft.XLANGs.Core.XMessage msg, string name, int index) : base(msg, name, index) { }

        
        #region part reflection support
        public static Microsoft.XLANGs.BaseTypes.SchemaBase PartSchema { get { return (Microsoft.XLANGs.BaseTypes.SchemaBase)_schema; } }
        #endregion // part reflection support
    }

    [Microsoft.XLANGs.BaseTypes.MessageTypeAttribute(
        Microsoft.XLANGs.BaseTypes.EXLangSAccess.ePublic,
        Microsoft.XLANGs.BaseTypes.EXLangSMessageInfo.eThirdKind,
        "PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Order",
        new System.Type[]{
            typeof(PeDALS.SC.Scheme.PSCorders.PublicServiceCommissionOrders_Order)
        },
        new string[]{
            "part"
        },
        new System.Type[]{
            typeof(__PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Order__)
        },
        0,
        @"order"
    )]
    [System.SerializableAttribute]
    sealed public class __messagetype_PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Order : Microsoft.BizTalk.XLANGs.BTXEngine.BTXMessage
    {
        public __PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Order__ part;

        private void __CreatePartWrappers()
        {
            part = new __PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Order__(this, "part", 0);
            this.AddPart("part", 0, part);
        }

        public __messagetype_PeDALS_SC_Scheme_PSCorders_PublicServiceCommissionOrders_Order(string msgName, Microsoft.XLANGs.Core.Context ctx) : base(msgName, ctx)
        {
            __CreatePartWrappers();
        }
    }

    [Microsoft.XLANGs.BaseTypes.BPELExportableAttribute(false)]
    sealed public class _MODULE_PROXY_ { }
}
